diff options
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r-- | src/client/util/DocumentManager.ts | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index fefd3a972..cf470a015 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -125,12 +125,23 @@ export class DocumentManager { } let docView = DocumentManager.Instance.getDocumentView(doc); if (docView) { - docView.props.Document.libraryBrush = true; - 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); + actualDoc.libraryBrush = true; + (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); + } + } + else { + docView.props.Document.libraryBrush = true; + docView.props.focus(docView.props.Document); + } } else { if (!contextDoc) { - const actualDoc = docDelegate ? (makeCopy ? Doc.MakeCopy(docDelegate) : docDelegate) : Doc.MakeDelegate(doc); - actualDoc.libraryBrush = true; + const actualDoc = Doc.MakeAlias(docDelegate); + (dockFunc || CollectionDockingView.Instance.AddRightSplit)(actualDoc); } else { let contextView = DocumentManager.Instance.getDocumentView(contextDoc); |