aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkMenuItem.tsx
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-07-01 15:40:55 -0400
committerab <abdullah_ahmed@brown.edu>2019-07-01 15:40:55 -0400
commit0fc7edd5f9bd1234f8de6e5b1c7b8f23668d784c (patch)
tree2ddff97c032657fb86de37c3be2cf2d201980088 /src/client/views/nodes/LinkMenuItem.tsx
parent4f8b7cecea3ceed6861c38bde9ce03c9c46e2d09 (diff)
parent6bd79baf2d9301304194d87667bb5c66c17e5298 (diff)
Merge branch 'monikasearch2' of https://github.com/browngraphicslab/Dash-Web into text_box_ab
Diffstat (limited to 'src/client/views/nodes/LinkMenuItem.tsx')
-rw-r--r--src/client/views/nodes/LinkMenuItem.tsx13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/views/nodes/LinkMenuItem.tsx b/src/client/views/nodes/LinkMenuItem.tsx
index 732e6de84..4dee6741f 100644
--- a/src/client/views/nodes/LinkMenuItem.tsx
+++ b/src/client/views/nodes/LinkMenuItem.tsx
@@ -7,7 +7,7 @@ import { undoBatch } from "../../util/UndoManager";
import './LinkMenu.scss';
import React = require("react");
import { Doc } from '../../../new_fields/Doc';
-import { StrCast, Cast } from '../../../new_fields/Types';
+import { StrCast, Cast, BoolCast, FieldValue } from '../../../new_fields/Types';
import { observable, action } from 'mobx';
import { LinkManager } from '../../util/LinkManager';
import { DragLinkAsDocument } from '../../util/DragManager';
@@ -32,10 +32,15 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
@undoBatch
onFollowLink = async (e: React.PointerEvent): Promise<void> => {
e.stopPropagation();
- if (DocumentManager.Instance.getDocumentView(this.props.destinationDoc)) {
- DocumentManager.Instance.jumpToDocument(this.props.destinationDoc, e.altKey);
+ let jumpToDoc = this.props.destinationDoc;
+ let pdfDoc = FieldValue(Cast(this.props.destinationDoc, Doc));
+ if (pdfDoc) {
+ jumpToDoc = pdfDoc;
+ }
+ if (DocumentManager.Instance.getDocumentView(jumpToDoc)) {
+ DocumentManager.Instance.jumpToDocument(jumpToDoc, e.altKey);
} else {
- CollectionDockingView.Instance.AddRightSplit(this.props.destinationDoc, undefined);
+ CollectionDockingView.Instance.AddRightSplit(jumpToDoc, undefined);
}
}