diff options
author | bobzel <zzzman@gmail.com> | 2020-08-27 20:36:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-08-27 20:36:58 -0400 |
commit | 749fbe6ae14497cb0397905657bd66cb0182707c (patch) | |
tree | 86e1bec332366db4e82b186ca7012c98e5aa2c9b | |
parent | a4b379c77ba579ad3d2c04ea08bc019347f2f56a (diff) |
from last
-rw-r--r-- | src/client/views/AntimodeMenu.tsx | 2 | ||||
-rw-r--r-- | src/client/views/nodes/PresBox.tsx | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/client/views/AntimodeMenu.tsx b/src/client/views/AntimodeMenu.tsx index 3b0c56adc..5acb3e4c8 100644 --- a/src/client/views/AntimodeMenu.tsx +++ b/src/client/views/AntimodeMenu.tsx @@ -1,5 +1,5 @@ import React = require("react"); -import { observable, action } from "mobx"; +import { observable, action, runInAction } from "mobx"; import "./AntimodeMenu.scss"; export interface AntimodeMenuProps { } diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 5e20b6f9f..5094c955f 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -259,9 +259,15 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> // adjust the pan and scale to that of the pinView when it was added. // TODO: Add option to remove presPinView if (activeItem.presPinView) { - targetDoc._panX = activeItem.presPinViewX; - targetDoc._panY = activeItem.presPinViewY; - targetDoc._viewScale = activeItem.presPinViewScale; + // if targetDoc has been closed, then we will have created and displayed + const bestTarget = DocumentManager.Instance.getFirstDocumentView(targetDoc)?.props.Document; + bestTarget && runInAction(() => { + bestTarget!._viewTransition = "all 1s"; + bestTarget!._panX = activeItem.presPinViewX; + bestTarget!._panY = activeItem.presPinViewY; + bestTarget!._viewScale = activeItem.presPinViewScale; + }); + //setTimeout(() => targetDoc._viewTransition = undefined, 1010); } // If website and has presWebsite data associated then on click it should // go back to that specific website @@ -613,8 +619,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> } // Key for when the presentaiton is active - @action - keyEvents = (e: KeyboardEvent) => { + @undoBatch + keyEvents = action((e: KeyboardEvent) => { if (e.target instanceof HTMLInputElement) return; let handled = false; const anchorNode = document.activeElement as HTMLDivElement; @@ -668,7 +674,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema> } handled = true; } - } + }) /** * |