diff options
| author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-07-17 11:00:55 +0530 |
|---|---|---|
| committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-07-17 11:00:55 +0530 |
| commit | 6a52a9510d48fda1ec94717ec7089ab922bc8613 (patch) | |
| tree | a2202dd6a319e94e2d8ae82478175ee145c9a30a /src/client/views/linking/LinkMenuGroup.tsx | |
| parent | 7543ca061700fda8286e6dd3f4374a877ccf929c (diff) | |
| parent | 60819bced2eb67282b77e25c77939dd45d01e7d8 (diff) | |
merge
Diffstat (limited to 'src/client/views/linking/LinkMenuGroup.tsx')
| -rw-r--r-- | src/client/views/linking/LinkMenuGroup.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/linking/LinkMenuGroup.tsx b/src/client/views/linking/LinkMenuGroup.tsx index 2f6b75437..2ae87ac13 100644 --- a/src/client/views/linking/LinkMenuGroup.tsx +++ b/src/client/views/linking/LinkMenuGroup.tsx @@ -11,6 +11,7 @@ import { DocumentView } from "../nodes/DocumentView"; import './LinkMenu.scss'; import { LinkMenuItem, StartLinkTargetsDrag } from "./LinkMenuItem"; import React = require("react"); +import { Cast } from "../../../fields/Types"; interface LinkMenuGroupProps { sourceDoc: Doc; @@ -66,7 +67,8 @@ export class LinkMenuGroup extends React.Component<LinkMenuGroupProps> { render() { const groupItems = this.props.group.map(linkDoc => { - const destination = LinkManager.Instance.getOppositeAnchor(linkDoc, this.props.sourceDoc); + const destination = LinkManager.Instance.getOppositeAnchor(linkDoc, this.props.sourceDoc) || + LinkManager.Instance.getOppositeAnchor(linkDoc, Cast(linkDoc.anchor2, Doc, null).annotationOn === this.props.sourceDoc ? Cast(linkDoc.anchor2, Doc, null) : Cast(linkDoc.anchor1, Doc, null)); if (destination && this.props.sourceDoc) { return <LinkMenuItem key={destination[Id] + this.props.sourceDoc[Id]} groupType={this.props.groupType} |
