diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-06-26 20:09:15 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-06-26 20:09:15 -0400 |
commit | 344d478d6140be1e469cfcd52ca76bbd1c4324f1 (patch) | |
tree | 1ee3ba5dd6a529af2333ada8603550493be141e4 /src/client/views/nodes/DocumentLinksButton.tsx | |
parent | 780ef6fec5add6a0b6b05f5fa64f47b1a2b71df4 (diff) | |
parent | 2043e0b55263e8168ccba8387a6b795a052da809 (diff) |
Merge branch 'master' into ink_menu
Diffstat (limited to 'src/client/views/nodes/DocumentLinksButton.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentLinksButton.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index ef900fff6..4f4f12521 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -17,6 +17,7 @@ export const Flyout = higflyout.default; interface DocumentLinksButtonProps { View: DocumentView; Offset?: number[]; + AlwaysOn?: boolean; } @observer export class DocumentLinksButton extends React.Component<DocumentLinksButtonProps, {}> { @@ -80,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} style={{ position: "absolute", left: this.props.Offset?.[0] }}> + 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)} |