diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-05-21 18:03:27 -0400 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-05-21 18:03:27 -0400 |
commit | 2c4026368078e2dc856c1cf4f8fe375cd30fbcdd (patch) | |
tree | 703a0a11063039af162678a32f706cfa2cfaaaf1 /src | |
parent | 2f1e56285750bcce6820ba2e1f24b7ad112b9db4 (diff) |
alt and linking
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/DocumentManager.ts | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index a5e768dcf..82776ff59 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -125,10 +125,20 @@ export class DocumentManager { } let docView = DocumentManager.Instance.getDocumentView(doc); if (docView) { - docView.props.focus(docView.props.Document); + console.log("navigating to linked doc..."); + // using makecopy as a flag for splitting linked to doc to the right...can change later if needed + if (makeCopy) { + if (!contextDoc) { + const actualDoc = Doc.MakeAlias(docDelegate); + (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); + } + } + else { + docView.props.focus(docView.props.Document); + } } else { if (!contextDoc) { - const actualDoc = docDelegate ? (makeCopy ? Doc.MakeCopy(docDelegate) : docDelegate) : Doc.MakeDelegate(doc); + const actualDoc = Doc.MakeAlias(docDelegate); (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); } else { let contextView = DocumentManager.Instance.getDocumentView(contextDoc); |