diff options
author | bob <bcz@cs.brown.edu> | 2020-01-21 17:07:35 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2020-01-21 17:07:35 -0500 |
commit | 7fffe13954ed0113bf1b2f9318518d015dc63844 (patch) | |
tree | aa9d16371e96a98216f0d288669e56c5b143b7f5 /src/client/views/nodes/DocuLinkBox.tsx | |
parent | 4eb5fde5f9b14d1b13c1995b9a1110347a57a582 (diff) |
made onClick override default link follow behavior
Diffstat (limited to 'src/client/views/nodes/DocuLinkBox.tsx')
-rw-r--r-- | src/client/views/nodes/DocuLinkBox.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocuLinkBox.tsx b/src/client/views/nodes/DocuLinkBox.tsx index 0d4d50c59..a4a9a62aa 100644 --- a/src/client/views/nodes/DocuLinkBox.tsx +++ b/src/client/views/nodes/DocuLinkBox.tsx @@ -61,10 +61,12 @@ export class DocuLinkBox extends DocComponent<FieldViewProps, DocLinkSchema>(Doc } } onClick = (e: React.MouseEvent) => { - if (Math.abs(e.clientX - this._downx) < 3 && Math.abs(e.clientY - this._downy) < 3 && (e.button !== 2 && !e.ctrlKey && this.props.Document.isButton)) { - DocumentManager.Instance.FollowLink(this.props.Document, this.props.Document[this.props.fieldKey] as Doc, document => this.props.addDocTab(document, undefined, "inTab"), false); + if (!this.props.Document.onClick) { + if (Math.abs(e.clientX - this._downx) < 3 && Math.abs(e.clientY - this._downy) < 3 && (e.button !== 2 && !e.ctrlKey && this.props.Document.isButton)) { + DocumentManager.Instance.FollowLink(this.props.Document, this.props.Document[this.props.fieldKey] as Doc, document => this.props.addDocTab(document, undefined, "inTab"), false); + } + e.stopPropagation(); } - e.stopPropagation(); } render() { |