diff options
author | kimdahey <claire_kim1@brown.edu> | 2019-07-16 21:01:11 -0400 |
---|---|---|
committer | kimdahey <claire_kim1@brown.edu> | 2019-07-16 21:01:11 -0400 |
commit | e3527a5f0334156a70b36980b8188ceb15ea5de3 (patch) | |
tree | 69725b68ebee2b5dd992544aa10fbf13944a5d78 /src | |
parent | bd18843342c186dd0e829250ba70bb8a2a8736b4 (diff) |
fixed undo on panning
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/DocumentManager.ts | 6 |
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) { |