diff options
author | bobzel <zzzman@gmail.com> | 2022-04-28 01:37:27 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-04-28 01:37:27 -0400 |
commit | 36261eac67ae6f872c9be2c9766d21ac24698f8e (patch) | |
tree | 8eb68e19a36629dfeedb2ae55d79a587eacaae73 /src/client/views/linking/LinkMenuItem.tsx | |
parent | d3eac62cbc55f186d9e2d3cc47407087fdc03ec7 (diff) |
fixed linkEditor to work when invoked from documentButtonsBar and properties sidebar is up.
Diffstat (limited to 'src/client/views/linking/LinkMenuItem.tsx')
-rw-r--r-- | src/client/views/linking/LinkMenuItem.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx index d6400a6b3..3ddcf803d 100644 --- a/src/client/views/linking/LinkMenuItem.tsx +++ b/src/client/views/linking/LinkMenuItem.tsx @@ -13,7 +13,6 @@ import { DragManager } from '../../util/DragManager'; import { Hypothesis } from '../../util/HypothesisUtils'; import { LinkManager } from '../../util/LinkManager'; import { undoBatch } from '../../util/UndoManager'; -import { DocumentLinksButton } from '../nodes/DocumentLinksButton'; import { DocumentView } from '../nodes/DocumentView'; import { LinkDocPreview } from '../nodes/LinkDocPreview'; import './LinkMenuItem.scss'; @@ -26,6 +25,7 @@ interface LinkMenuItemProps { docView: DocumentView; sourceDoc: Doc; destinationDoc: Doc; + clearLinkEditor: () => void; showEditor: (linkDoc: Doc) => void; menuRef: React.Ref<HTMLDivElement>; itemHandler?: (doc: Doc) => void; @@ -92,12 +92,12 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> { const eleClone: any = this._drag.current!.cloneNode(true); eleClone.style.transform = `translate(${e.x}px, ${e.y}px)`; StartLinkTargetsDrag(eleClone, this.props.docView, e.x, e.y, this.props.sourceDoc, [this.props.linkDoc]); - DocumentLinksButton.ClearLinkEditor(); + this.props.clearLinkEditor(); return true; }, emptyFunction, () => { - DocumentLinksButton.ClearLinkEditor(); + this.props.clearLinkEditor(); if (this.props.itemHandler) { this.props.itemHandler?.(this.props.linkDoc); |