aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkMenuItem.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-06-21 13:41:25 -0400
committerFawn <fangrui_tong@brown.edu>2019-06-21 13:41:25 -0400
commit60f9122ea31d660d60d5429890c4eb0ef6d8613b (patch)
tree0231994ccdf4a5e2fb30f77d3fd73a09f1fb4b67 /src/client/views/nodes/LinkMenuItem.tsx
parentd78c651322ad228152b862eaa378946fe65cc9f9 (diff)
following link without viewdoc opens it to right
Diffstat (limited to 'src/client/views/nodes/LinkMenuItem.tsx')
-rw-r--r--src/client/views/nodes/LinkMenuItem.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/nodes/LinkMenuItem.tsx b/src/client/views/nodes/LinkMenuItem.tsx
index c68365584..1ef4690b0 100644
--- a/src/client/views/nodes/LinkMenuItem.tsx
+++ b/src/client/views/nodes/LinkMenuItem.tsx
@@ -12,6 +12,7 @@ import { observable, action } from 'mobx';
import { LinkManager } from '../../util/LinkManager';
import { DragLinksAsDocuments, DragLinkAsDocument } from '../../util/DragManager';
import { SelectionManager } from '../../util/SelectionManager';
+import { CollectionDockingView } from '../collections/CollectionDockingView';
library.add(faEye, faEdit, faTimes, faArrowRight, faChevronDown, faChevronUp);
@@ -32,7 +33,11 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
@undoBatch
onFollowLink = async (e: React.PointerEvent): Promise<void> => {
e.stopPropagation();
- DocumentManager.Instance.jumpToDocument(this.props.destinationDoc, e.altKey);
+ if (DocumentManager.Instance.getDocumentView(this.props.destinationDoc)) {
+ DocumentManager.Instance.jumpToDocument(this.props.destinationDoc, e.altKey);
+ } else {
+ CollectionDockingView.Instance.AddRightSplit(this.props.destinationDoc);
+ }
}
onEdit = (e: React.PointerEvent): void => {