diff options
author | bobzel <zzzman@gmail.com> | 2020-08-03 13:37:24 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-03 13:37:24 -0400 |
commit | 3dc66a77097b0ee3ea9aa1d29b9a3a63667ed3b3 (patch) | |
tree | cf00ddc9c6ee81145967c8824c7f08a35d933082 /src | |
parent | 7ee8d49ea0d94a365289fe4248a7ee603d405315 (diff) |
fixes for flyouts and button colors.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/MainView.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 09980ce97..47bccce43 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))); } @@ -389,7 +389,10 @@ export class MainView extends React.Component { setupMoveUpEvents(this, e, action((e: PointerEvent) => { this.flyoutWidth = Math.max(e.clientX, 0); return false; - }), emptyFunction, action(() => this.flyoutWidth = this.flyoutWidth < 15 ? 250 : 0)); + }), emptyFunction, action(() => { + if (this.flyoutWidth < 15) MainView.expandFlyout(); + else this.closeFlyout(); + })); } } @@ -480,8 +483,8 @@ export class MainView extends React.Component { @action @undoBatch closeFlyout = () => { - // this._lastButton && (this._lastButton.color = "white"); - // this._lastButton && (this._lastButton._backgroundColor = ""); + this._lastButton && (this._lastButton.color = "white"); + this._lastButton && (this._lastButton._backgroundColor = ""); this.panelContent = "none"; this.flyoutWidth = 0; } |