aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/AntimodeMenu.tsx2
-rw-r--r--src/client/views/nodes/PresBox.tsx18
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;
}
- }
+ })
/**
*