aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentLinksButton.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-25 14:47:03 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-25 14:47:03 -0500
commita1daa25fa9db681774376fe52d62c6b6d5c32a76 (patch)
tree9b0b3d9839b39e6e8d23552841a46b2a04d839c7 /src/client/views/nodes/DocumentLinksButton.tsx
parentb32aa12c76d673bb0cf339741398a1fd1441167c (diff)
parent29dc4667206b58bca76f28d39fa8c4b0db040d66 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into anika_schema_view
Diffstat (limited to 'src/client/views/nodes/DocumentLinksButton.tsx')
-rw-r--r--src/client/views/nodes/DocumentLinksButton.tsx10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx
index fc314ae8b..4f4f12521 100644
--- a/src/client/views/nodes/DocumentLinksButton.tsx
+++ b/src/client/views/nodes/DocumentLinksButton.tsx
@@ -16,6 +16,8 @@ export const Flyout = higflyout.default;
interface DocumentLinksButtonProps {
View: DocumentView;
+ Offset?: number[];
+ AlwaysOn?: boolean;
}
@observer
export class DocumentLinksButton extends React.Component<DocumentLinksButtonProps, {}> {
@@ -79,17 +81,17 @@ export class DocumentLinksButton extends React.Component<DocumentLinksButtonProp
@computed
get linkButton() {
const links = DocListCast(this.props.View.props.Document.links);
- return !links.length || links[0].hidden ? (null) :
- <div title="Drag(create link) Tap(view links)" ref={this._linkButton}>
+ return (!links.length || links[0].hidden) && !this.props.AlwaysOn ? (null) :
+ <div title="Drag(create link) Tap(view links)" ref={this._linkButton} style={{ minWidth: 20, minHeight: 20, position: "absolute", left: this.props.Offset?.[0] }}>
<div className={"documentLinksButton"} style={{ backgroundColor: DocumentLinksButton.StartLink ? "transparent" : "" }}
onPointerDown={this.onLinkButtonDown}
onPointerLeave={action(() => LinkDocPreview.LinkInfo = undefined)}
- onPointerEnter={action(e => LinkDocPreview.LinkInfo = {
+ onPointerEnter={action(e => links.length && (LinkDocPreview.LinkInfo = {
addDocTab: this.props.View.props.addDocTab,
linkSrc: this.props.View.props.Document,
linkDoc: links[0],
Location: [e.clientX, e.clientY + 20]
- })} >
+ }))} >
{links.length ? links.length : <FontAwesomeIcon className="documentdecorations-icon" icon="link" size="sm" />}
</div>
{DocumentLinksButton.StartLink && DocumentLinksButton.StartLink !== this.props.View ? <div className={"documentLinksButton-endLink"} onPointerDown={this.completeLink} /> : (null)}