diff options
| author | srichman333 <sarah_n_richman@brown.edu> | 2023-10-10 16:21:41 -0400 |
|---|---|---|
| committer | srichman333 <sarah_n_richman@brown.edu> | 2023-10-10 16:21:41 -0400 |
| commit | 9e91e6065333f03d3f3bf2c0d43b822d85344c78 (patch) | |
| tree | 4c923fc8257b597d69700bee4c1a4e69d3cbe21a /src/client/views/PropertiesDocBacklinksSelector.tsx | |
| parent | 368e33c076085b1b73f522ac88f548a2ad081c80 (diff) | |
| parent | d929c0511cae863412a398f426d9e5b7ca64e6d9 (diff) | |
merge?
Diffstat (limited to 'src/client/views/PropertiesDocBacklinksSelector.tsx')
| -rw-r--r-- | src/client/views/PropertiesDocBacklinksSelector.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/PropertiesDocBacklinksSelector.tsx b/src/client/views/PropertiesDocBacklinksSelector.tsx index 91a7b3da3..b1e99c3f5 100644 --- a/src/client/views/PropertiesDocBacklinksSelector.tsx +++ b/src/client/views/PropertiesDocBacklinksSelector.tsx @@ -1,3 +1,4 @@ +import { action } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import { Doc } from '../../fields/Doc'; @@ -6,6 +7,7 @@ import { DocumentType } from '../documents/DocumentTypes'; import { LinkManager } from '../util/LinkManager'; import { SelectionManager } from '../util/SelectionManager'; import { SettingsManager } from '../util/SettingsManager'; +import { CollectionDockingView } from './collections/CollectionDockingView'; import { LinkMenu } from './linking/LinkMenu'; import { OpenWhere, OpenWhereMod } from './nodes/DocumentView'; import './PropertiesDocBacklinksSelector.scss'; @@ -19,16 +21,17 @@ type PropertiesDocBacklinksSelectorProps = { @observer export class PropertiesDocBacklinksSelector extends React.Component<PropertiesDocBacklinksSelectorProps> { - getOnClick = (link: Doc) => { + getOnClick = action((link: Doc) => { const linkAnchor = this.props.Document; const other = LinkManager.getOppositeAnchor(link, linkAnchor); const otherdoc = !other ? undefined : other.annotationOn && other.type !== DocumentType.RTF ? Cast(other.annotationOn, Doc, null) : other; - + LinkManager.currentLink = link; if (otherdoc) { otherdoc.hidden = false; this.props.addDocTab(Doc.IsDataProto(otherdoc) ? Doc.MakeDelegate(otherdoc) : otherdoc, OpenWhere.toggleRight); + CollectionDockingView.Instance?.endUndoBatch(); } - }; + }); render() { return !SelectionManager.Views().length ? null : ( |
