From 8fd63cf68228105aca4622a55bfa9a69527ef341 Mon Sep 17 00:00:00 2001 From: Lionel Han <47760119+IGoByJoe@users.noreply.github.com> Date: Mon, 1 Jun 2020 20:33:06 -0700 Subject: toggle for ink, scroll menu --- src/mobile/MobileInterface.tsx | 46 +++++++++++++++++++++++++++++++++--------- src/mobile/MobileMenu.scss | 12 +++++++++++ 2 files changed, 49 insertions(+), 9 deletions(-) (limited to 'src/mobile') diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index 5c89d7612..dc0d70c0b 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -69,6 +69,7 @@ export default class MobileInterface extends React.Component { constructor(props: Readonly<{}>) { super(props); MobileInterface.Instance = this; + } @action @@ -78,6 +79,8 @@ export default class MobileInterface extends React.Component { if (this.userDoc && !this.mainContainer) { this.userDoc.activeMobile = this.mainDoc; } + InkingControl.Instance.switchTool(InkTool.None) + MobileInterface.Instance.drawingInk = false; } @action @@ -94,9 +97,33 @@ export default class MobileInterface extends React.Component { if (!this._ink) { InkingControl.Instance.switchTool(InkTool.Pen); MobileInterface.Instance.drawingInk = true; + this._ink = true; + DocServer.Mobile.dispatchOverlayTrigger({ + enableOverlay: true, + width: window.innerWidth, + height: window.innerHeight + }); } else { + InkingControl.Instance.switchTool(InkTool.None) MobileInterface.Instance.drawingInk = false; + this._ink = false; + + DocServer.Mobile.dispatchOverlayTrigger({ + enableOverlay: false, + width: window.innerWidth, + height: window.innerHeight + }); + } + + this.toggleSidebar(); + } + + getInkStatus = () => { + if (this._ink) { + return "ink off"; + } else { + return "ink on"; } } @@ -144,7 +171,7 @@ export default class MobileInterface extends React.Component { back = () => { let doc = Cast(this._parents.pop(), Doc) as Doc; - if (doc == Cast(this._menu, Doc) as Doc) { + if (doc === Cast(this._menu, Doc) as Doc) { this._child = null; this.userDoc.activeMobile = this.mainDoc; } else { @@ -223,9 +250,9 @@ export default class MobileInterface extends React.Component { if (doc === this.mainDoc) { pathname = pathname; } else if (doc.title === "mobile audio" || doc.title === "Presentation") { - pathname = pathname + pathname = pathname; } else if (doc.type !== "collection") { - pathname = pathname + pathname = pathname; } else { pathname = pathname + " > " + doc.title; } @@ -283,6 +310,7 @@ export default class MobileInterface extends React.Component {