aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-05-31 23:08:34 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-05-31 23:08:34 -0700
commitcd2376cef00ae2b06b53480646a1e9ac8b246630 (patch)
tree32e02dec3411019cae05fc553152e9c8f4a20754 /src
parent662ab0537e6b7b3d15fd44b6e2695052025ed83b (diff)
fixed path bug
Diffstat (limited to 'src')
-rw-r--r--src/mobile/MobileInterface.tsx42
1 files changed, 26 insertions, 16 deletions
diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx
index 4c36fdb9b..5c89d7612 100644
--- a/src/mobile/MobileInterface.tsx
+++ b/src/mobile/MobileInterface.tsx
@@ -64,6 +64,7 @@ export default class MobileInterface extends React.Component {
private _menu: Doc = this.mainDoc;
private _open: boolean = false;
private _library: Doc = Cast(this.userDoc.myWorkspaces, Doc) as Doc;
+ private _ink: boolean = false;
constructor(props: Readonly<{}>) {
super(props);
@@ -90,14 +91,13 @@ export default class MobileInterface extends React.Component {
}
onSwitchInking = () => {
- InkingControl.Instance.switchTool(InkTool.Pen);
- MobileInterface.Instance.drawingInk = true;
+ if (!this._ink) {
+ InkingControl.Instance.switchTool(InkTool.Pen);
+ MobileInterface.Instance.drawingInk = true;
- DocServer.Mobile.dispatchOverlayTrigger({
- enableOverlay: true,
- width: window.innerWidth,
- height: window.innerHeight
- });
+ } else {
+ MobileInterface.Instance.drawingInk = false;
+ }
}
onSwitchUpload = async () => {
@@ -215,25 +215,34 @@ export default class MobileInterface extends React.Component {
this.switchCurrentView((userDoc: Doc) => doc);
this._child = doc;
}
-
- // let sidebar = document.getElementById("sidebar") as HTMLElement;
- // sidebar.classList.toggle('active');
}
createPathname = () => {
- let pathname = "";
+ let pathname = "workspaces";
this._parents.map((doc: Doc, index: any) => {
if (doc === this.mainDoc) {
- pathname = pathname + doc.title;
+ pathname = pathname;
+ } else if (doc.title === "mobile audio" || doc.title === "Presentation") {
+ pathname = pathname
+ } else if (doc.type !== "collection") {
+ pathname = pathname
} else {
pathname = pathname + " > " + doc.title;
}
});
if (this._activeDoc === this.mainDoc) {
- pathname = pathname + this._activeDoc.title;
+ pathname = pathname;
} else {
pathname = pathname + " > " + this._activeDoc.title;
}
+
+ if (this._activeDoc.title === "mobile audio") {
+ pathname = this._activeDoc.title;
+ }
+
+ if (this._activeDoc.title === "Presentation") {
+ pathname = this._activeDoc.title;
+ }
return pathname;
}
@@ -302,7 +311,7 @@ export default class MobileInterface extends React.Component {
<div className="item" key="settings" onClick={() => SettingsManager.Instance.open()}>
Settings
</div>
- <div className="item" key="ink" onClick={() => CurrentUserUtils.setupDockedButtons(this._activeDoc)}>
+ <div className="item" key="ink" onClick={() => this.onSwitchInking()}>
Ink
</div>
</div>
@@ -351,7 +360,7 @@ export default class MobileInterface extends React.Component {
recordAudio = async () => {
// upload to server with known URL
-
+ this._parents.push(this._activeDoc);
const audioDoc = Cast(Docs.Create.AudioDocument(nullAudio, { _width: 200, _height: 100, title: "mobile audio" }), Doc) as Doc;
if (audioDoc) {
console.log("audioClicked: " + audioDoc.title);
@@ -370,6 +379,7 @@ export default class MobileInterface extends React.Component {
}
openDefaultPresentation = () => {
+ this._parents.push(this._activeDoc);
const presentation = Cast(Doc.UserDoc().activePresentation, Doc) as Doc;
if (presentation) {
@@ -515,8 +525,8 @@ export default class MobileInterface extends React.Component {
<SettingsManager />
<GestureOverlay>
{this.displayWorkspaces()}
- {this.renderDefaultContent()}
</GestureOverlay>
+ {this.renderDefaultContent()}
{/* </GestureOverlay> */}
{/* <DictationOverlay />
<SharingManager />