From 1e8d0c5395e7a5760d8d759c237e808856d369a3 Mon Sep 17 00:00:00 2001 From: srichman333 Date: Mon, 16 Oct 2023 16:51:22 -0400 Subject: sidebar opens when following link --- src/client/views/nodes/DataVizBox/DataVizBox.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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() { 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>(res => DocumentManager.Instance.AddViewRenderedCb(doc, dv => res(dv))); + }; @computed get sidebarWidthPercent() { return StrCast(this.layoutDoc._layout_sidebarWidthPercent, '0%'); } -- cgit v1.2.3-70-g09d2