From 11ab63f6c91093951fdc293c3d67e63073fb2f4c Mon Sep 17 00:00:00 2001
From: Monika Hedman <monika_hedman@brown.edu>
Date: Tue, 7 May 2019 17:42:37 -0400
Subject: navigate to searched doc

---
 src/client/views/nodes/LinkBox.tsx | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

(limited to 'src/client/views/nodes/LinkBox.tsx')

diff --git a/src/client/views/nodes/LinkBox.tsx b/src/client/views/nodes/LinkBox.tsx
index 08cfa590b..611cb66b6 100644
--- a/src/client/views/nodes/LinkBox.tsx
+++ b/src/client/views/nodes/LinkBox.tsx
@@ -31,28 +31,7 @@ export class LinkBox extends React.Component<Props> {
     @undoBatch
     onViewButtonPressed = async (e: React.PointerEvent): Promise<void> => {
         e.stopPropagation();
-        let docView = DocumentManager.Instance.getDocumentView(this.props.pairedDoc);
-        if (docView) {
-            docView.props.focus(docView.props.Document);
-        } else {
-            const contextDoc = await Cast(this.props.pairedDoc.annotationOn, Doc);
-            if (!contextDoc) {
-                CollectionDockingView.Instance.AddRightSplit(Doc.MakeDelegate(this.props.pairedDoc));
-            } else {
-                const page = NumCast(this.props.pairedDoc.page, undefined);
-                const curPage = NumCast(contextDoc.curPage, undefined);
-                if (page !== curPage) {
-                    contextDoc.curPage = page;
-                }
-                let contextView = DocumentManager.Instance.getDocumentView(contextDoc);
-                if (contextView) {
-                    contextDoc.panTransformType = "Ease";
-                    contextView.props.focus(contextDoc);
-                } else {
-                    CollectionDockingView.Instance.AddRightSplit(contextDoc);
-                }
-            }
-        }
+        DocumentManager.Instance.jumpToDocument(this.props.pairedDoc);
     }
 
     onEditButtonPressed = (e: React.PointerEvent): void => {
-- 
cgit v1.2.3-70-g09d2

