From 56da30314c4d434c4b7bb8be94f3bcb5923790d8 Mon Sep 17 00:00:00 2001 From: Lionel Han <47760119+IGoByJoe@users.noreply.github.com> Date: Mon, 29 Jun 2020 18:05:46 -0700 Subject: minor changes --- .../collectionFreeForm/InkOptionsMenu.tsx | 5 ++- src/mobile/MobileInterface.tsx | 37 +++++++++++++--------- 2 files changed, 26 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx index e5b7023a1..218cef183 100644 --- a/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx +++ b/src/client/views/collections/collectionFreeForm/InkOptionsMenu.tsx @@ -320,10 +320,13 @@ export default class InkOptionsMenu extends AntimodeMenu { ]; const mobileButtons = [ - ...this.shapeButtons, + this.shapePicker, this.bezierButton, this.widthPicker, this.colorPicker, + this.fillPicker, + this.arrowPicker, + this.dashButton, ]; return (window.screen.width < 600 ? this.getElement(mobileButtons) : this.getElement(buttons)); diff --git a/src/mobile/MobileInterface.tsx b/src/mobile/MobileInterface.tsx index a49bfb9b1..cb7319e03 100644 --- a/src/mobile/MobileInterface.tsx +++ b/src/mobile/MobileInterface.tsx @@ -56,6 +56,8 @@ export class MobileInterface extends React.Component { @observable private audioUploadActive: boolean = false; @observable private menuListView: boolean = false; //to switch between menu view (list / icon) @observable private _ink: boolean = false; //toggle whether ink is being dispalyed + @observable private inkButton: boolean = false; + @observable private undoButton: boolean = false; public _activeDoc: Doc = this.mainDoc; // doc updated as the active mobile page is updated (initially home menu) public _homeDoc: Doc = this.mainDoc; // home menu as a document @@ -107,6 +109,10 @@ export class MobileInterface extends React.Component { this.renderView = renderView; // Ensures that switching to home is not registed UndoManager.undoStack.length = 0; + + if (this._activeDoc.type === "collection" && this._activeDoc !== this._homeDoc && this._activeDoc !== this.userDoc.rightSidebarCollection && this._activeDoc.title !== "WORKSPACES") { + this.undoButton = true; + } } // For toggling the hamburger menu @@ -445,7 +451,7 @@ export class MobileInterface extends React.Component { const freeformOptions: DocumentOptions = { x: 0, y: 400, - title: "Collection " + workspaceCount + title: "Collection " + workspaceCount, }; const freeformDoc = CurrentUserUtils.GuestTarget || Docs.Create.FreeformDocument([], freeformOptions); const workspaceDoc = Docs.Create.StandardCollectionDockingDocument([{ doc: freeformDoc, initialWidth: 600, path: [Doc.UserDoc().myCatalog as Doc] }], { title: `Workspace ${workspaceCount}` }, id, "row"); @@ -493,19 +499,21 @@ export class MobileInterface extends React.Component { // DocButton that uses UndoManager and handles the opacity change if CanUndo is true @computed get undo() { - if (this._activeDoc.type === "collection" && this._activeDoc !== this._homeDoc && this._activeDoc !== this.userDoc.rightSidebarCollection && this._activeDoc.title !== "WORKSPACES") { - return (<> -
{ - UndoManager.Undo(); - e.stopPropagation(); - }}> - -
- ); + if (this.mainContainer) { + if (this._activeDoc.type === "collection" && this._activeDoc !== this._homeDoc && this._activeDoc !== this.userDoc.rightSidebarCollection && this._activeDoc.title !== "WORKSPACES") { + return (<> +
{ + UndoManager.Undo(); + e.stopPropagation(); + }}> + +
+ ); + } } } @@ -704,7 +712,6 @@ export class MobileInterface extends React.Component { } onDragOver = (e: React.DragEvent) => { - console.log("drag!"); e.preventDefault(); e.stopPropagation(); } -- cgit v1.2.3-70-g09d2