aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorStanley Yip <33562077+yipstanley@users.noreply.github.com>2019-07-17 14:56:52 +0000
committerGitHub <noreply@github.com>2019-07-17 14:56:52 +0000
commit1610f9e7bfac3de61d3b6de108a0664e1266e5ba (patch)
tree78cb59565eb78955e089a11d96011da79e0c81c7 /src/client/util/DocumentManager.ts
parentba25d48d52f6db6021f5149e39021f651af22317 (diff)
parent253813f3ed75c5bbc08f32a1e822ff922bfe185b (diff)
Merge pull request #212 from browngraphicslab/small_fix_0716
fixed undo on panning
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index bb1345044..262194a40 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -3,7 +3,7 @@ import { DocumentView } from '../views/nodes/DocumentView';
import { Doc, DocListCast, Opt } from '../../new_fields/Doc';
import { FieldValue, Cast, NumCast, BoolCast, StrCast } from '../../new_fields/Types';
import { listSpec } from '../../new_fields/Schema';
-import { undoBatch } from './UndoManager';
+import { undoBatch, UndoManager } from './UndoManager';
import { CollectionDockingView } from '../views/collections/CollectionDockingView';
import { CollectionView } from '../views/collections/CollectionView';
import { CollectionPDFView } from '../views/collections/CollectionPDFView';
@@ -142,7 +142,9 @@ export class DocumentManager {
if (!forceDockFunc && (docView = DocumentManager.Instance.getDocumentView(doc))) {
docView.props.Document.libraryBrush = true;
if (linkPage !== undefined) docView.props.Document.curPage = linkPage;
- docView.props.focus(docView.props.Document, willZoom);
+ UndoManager.RunInBatch(() => {
+ docView!.props.focus(docView!.props.Document, willZoom);
+ }, "focus");
} else {
if (!contextDoc) {
if (docContext) {