diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-07-18 17:43:21 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-07-18 17:43:21 -0400 |
commit | 9cba3f3a7285b08d3b805a39294b731ae0cd1de2 (patch) | |
tree | 49477ee33e3fa8e217243dadcfccf56c6f33f279 /src | |
parent | 2df5e1fb9c249ab29c0d8fc56d0a2ce394ae6643 (diff) |
fixed long linking to work with text selections
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/DocumentButtonBar.tsx | 1 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentLinksButton.tsx | 9 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index 45f4c7393..c99034d81 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -51,7 +51,6 @@ enum UtilityButtonState { @observer export class DocumentButtonBar extends React.Component<{ views: () => (DocumentView | undefined)[], stack?: any }, {}> { - private _linkButton = React.createRef<HTMLDivElement>(); private _dragRef = React.createRef<HTMLDivElement>(); private _pullAnimating = false; private _pushAnimating = false; diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index bbef48e44..13bec5d7f 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -93,9 +93,6 @@ export class DocumentLinksButton extends React.Component<DocumentLinksButtonProp if (doubleTap && this.props.InMenu && !!!this.props.StartLink) { if (DocumentLinksButton.StartLink === this.props.View) { DocumentLinksButton.StartLink = undefined; - // action((e: React.PointerEvent<HTMLDivElement>) => { - // Doc.UnBrushDoc(this.props.View.Document); - // }); } else { if (DocumentLinksButton.StartLink && DocumentLinksButton.StartLink !== this.props.View) { @@ -126,13 +123,13 @@ export class DocumentLinksButton extends React.Component<DocumentLinksButtonProp finishLinkClick = (e: React.MouseEvent) => { if (DocumentLinksButton.StartLink === this.props.View) { DocumentLinksButton.StartLink = undefined; - // action((e: React.PointerEvent<HTMLDivElement>) => { - // Doc.UnBrushDoc(this.props.View.Document); - // }); } else { if (this.props.InMenu && !!!this.props.StartLink) { if (DocumentLinksButton.StartLink && DocumentLinksButton.StartLink !== this.props.View) { const linkDoc = DocUtils.MakeLink({ doc: DocumentLinksButton.StartLink.props.Document }, { doc: this.props.View.props.Document }, "long drag"); + // this notifies any of the subviews that a document is made so that they can make finer-grained hyperlinks (). see note above in onLInkButtonMoved + runInAction(() => DocumentLinksButton.StartLink!._link = this.props.View._link = linkDoc); + setTimeout(action(() => DocumentLinksButton.StartLink!._link = this.props.View._link = undefined), 0); LinkManager.currentLink = linkDoc; runInAction(() => { |