From ce3e290c66629aa85d6ddeb9aab93165a8d636aa Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Fri, 8 Nov 2024 00:25:18 -0500 Subject: loading indicator in layout preview works properly --- .../DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx | 31 +++++----------------- 1 file changed, 6 insertions(+), 25 deletions(-) (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx') diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx index 3cdde90d5..257c7fc00 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx @@ -968,23 +968,6 @@ export class DocCreatorMenu extends ObservableReactComponent { ); } - get savedLayoutsPreviewContents() { - return ( -
- {this._savedLayouts.map((layout, index) => ( -
this.setUpButtonClick(e, () => runInAction(() => this.updateSelectedSavedLayout(layout)))}> - {this.layoutPreviewContents(87, layout, true, index)} -
- ))} -
- ); - } @action updateXMargin = (input: string) => { this._layout.xMargin = Number(input); @@ -1128,14 +1111,14 @@ export class DocCreatorMenu extends ObservableReactComponent { this._renderedDocCollection = collection; } - layoutPreviewContents = (outerSpan: number, altLayout?: DataVizTemplateLayout, small: boolean = false, id?: number) => { - const doc: Doc | undefined = altLayout ? altLayout.template : this._fullyRenderedDocs[0]; //!!! might cause a slow down - if (!doc) return; + layoutPreviewContents = (id?: number) => { return this._docsRendering ? ( -
- -
+
+
+ +
+
) : !this._renderedDocCollection? null : (
{ return this.templatesPreviewContents; case 'options': return this.optionsMenuContents; - case 'saved': - return this.savedLayoutsPreviewContents; case 'dashboard': return this.dashboardContents; default: -- cgit v1.2.3-70-g09d2