diff options
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r-- | src/client/util/DocumentManager.ts | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index a3c7429b9..c048125c5 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -132,9 +132,7 @@ export class DocumentManager { let doc = Doc.GetProto(docDelegate); const contextDoc = await Cast(doc.annotationOn, Doc); if (contextDoc) { - const page = NumCast(doc.page, linkPage || 0); - const curPage = NumCast(contextDoc.curPage, page); - if (page !== curPage) contextDoc.curPage = page; + contextDoc.scrollY = NumCast(doc.y) - NumCast(contextDoc.height) / 2; } let docView: DocumentView | null; @@ -180,7 +178,7 @@ export class DocumentManager { (dockFunc || CollectionDockingView.AddRightSplit)(contextDoc, undefined); setTimeout(() => { this.jumpToDocument(docDelegate, willZoom, forceDockFunc, dockFunc, linkPage); - }, 10); + }, 1000); } } } @@ -188,13 +186,8 @@ export class DocumentManager { @action zoomIntoScale = (docDelegate: Doc, scale: number) => { - let doc = Doc.GetProto(docDelegate); - - let docView: DocumentView | null; - docView = DocumentManager.Instance.getDocumentView(doc); - if (docView) { - docView.props.zoomToScale(scale); - } + let docView = DocumentManager.Instance.getDocumentView(Doc.GetProto(docDelegate)); + docView && docView.props.zoomToScale(scale); } getScaleOfDocView = (docDelegate: Doc) => { |