diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-10-16 16:51:22 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-10-16 16:51:22 -0400 |
commit | 1e8d0c5395e7a5760d8d759c237e808856d369a3 (patch) | |
tree | f85be5fddb190ffa4c9a13721113f0f1da930d51 /src | |
parent | def79740fe8054a03772035990b4355c9aa24ebc (diff) |
sidebar opens when following link
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DataVizBox.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index b154a3607..9692345a6 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -21,6 +21,8 @@ import { PDFBox } from '../PDFBox'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { emptyFunction, setupMoveUpEvents } from '../../../../Utils'; import { LinkManager } from '../../../util/LinkManager'; +import { DocumentView } from '../DocumentView'; +import { DocumentManager } from '../../../util/DocumentManager'; export enum DataVizView { TABLE = 'table', @@ -178,9 +180,13 @@ export class DataVizBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { return false; }), emptyFunction, - () => UndoManager.RunInBatch(this.toggleSidebar, 'toggle sidebar map') + () => UndoManager.RunInBatch(this.toggleSidebar, 'toggle sidebar') ); }; + getView = async (doc: Doc) => { + if (this._sidebarRef?.current?.makeDocUnfiltered(doc) && !this.SidebarShown) this.toggleSidebar(); + return new Promise<Opt<DocumentView>>(res => DocumentManager.Instance.AddViewRenderedCb(doc, dv => res(dv))); + }; @computed get sidebarWidthPercent() { return StrCast(this.layoutDoc._layout_sidebarWidthPercent, '0%'); } |