diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/MainView.tsx | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 8ee34a4b0..ca5154ef7 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -150,7 +150,7 @@ export class MainView extends React.Component { if (type === "doc") { CurrentUserUtils.MainDocId = pathname[1]; if (!this.userDoc) { - runInAction(() => this.flyoutWidth = 0); + runInAction(() => this.closeFlyout()); DocServer.GetRefField(CurrentUserUtils.MainDocId).then(action((field: Opt<Field>) => field instanceof Doc && (CurrentUserUtils.GuestTarget = field))); } @@ -393,17 +393,10 @@ export class MainView extends React.Component { this._lastButton && (this._lastButton._backgroundColor = ""); } return false; - }), emptyFunction, this.openCloseFlyout); - } - } - - @action - openCloseFlyout = () => { - this.flyoutWidth = this.flyoutWidth < 15 ? 250 : 0; - if (this.flyoutWidth < 15) { - this.panelContent = "none"; - this._lastButton && (this._lastButton.color = "white"); - this._lastButton && (this._lastButton._backgroundColor = ""); + }), emptyFunction, action(() => { + if (this.flyoutWidth < 15) MainView.expandFlyout(); + else this.closeFlyout(); + })); } } |