aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-05-31 18:18:05 -0400
committerbob <bcz@cs.brown.edu>2019-05-31 18:18:05 -0400
commitd1b0f462ced168f3a9ac5d007ba1219e98a3b6cf (patch)
tree1f18ae22381bc93976fa37005accd7c9c803dc60 /src/client/views/nodes/FormattedTextBox.tsx
parent0348b9f5ecb5419965bcd9eb5a37d629dd4f3a6e (diff)
stacking views and more..
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 5d93edaac..3b61c68dd 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -230,20 +230,15 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
this._toolTipTextMenu.tooltip.style.opacity = "0";
}
}
+ let ctrlKey = e.ctrlKey;
if (e.button === 0 && ((!this.props.isSelected() && !e.ctrlKey) || (this.props.isSelected() && e.ctrlKey)) && !e.metaKey) {
if (e.target && (e.target as any).href) {
let href = (e.target as any).href;
if (href.indexOf(DocServer.prepend("/doc/")) === 0) {
let docid = href.replace(DocServer.prepend("/doc/"), "").split("?")[0];
- DocServer.GetRefField(docid).then(action((f: Opt<Field>) => {
- if (f instanceof Doc) {
- if (DocumentManager.Instance.getDocumentView(f)) {
- DocumentManager.Instance.getDocumentView(f)!.props.focus(f);
- } else {
- this.props.addDocTab && this.props.addDocTab(f, "onRight");
- }
- }
- }));
+ DocServer.GetRefField(docid).then(f => {
+ (f instanceof Doc) && DocumentManager.Instance.jumpToDocument(f, ctrlKey, document => this.props.addDocTab(document, "inTab"))
+ });
}
e.stopPropagation();
e.preventDefault();