aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authortschicke-brown <tyler_schicke@brown.edu>2019-05-21 18:36:55 -0400
committerGitHub <noreply@github.com>2019-05-21 18:36:55 -0400
commitf16a5c689fb075ad232e2c076a47030f6080d1c0 (patch)
tree7d55626e1cd78722c9ec297f9efce8de0f6c7265 /src/client/util/DocumentManager.ts
parent3020cfcf20d187c976a7f386a95bec0c41cba06b (diff)
parentd8e75e672f1384dc68af1f63aabd68d8b6820adb (diff)
Merge pull request #147 from browngraphicslab/cont_menu_ui
Fixes to search bar
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts19
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);