From 56030ba4d7f1038095562ecd4c2937faebe80a30 Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Thu, 18 Jul 2024 04:40:13 -0400 Subject: option to remove saved layout --- src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx index fdf623150..cb10de65b 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx @@ -244,7 +244,7 @@ export class DocCreatorMenu extends ObservableReactComponent<{}> { }} onPointerDown={e => this.setUpButtonClick(e, () => runInAction(() => this.updateSelectedSavedLayout(layout)))} > - {this.layoutPreviewContents(87, layout, false, true, index)} + {this.layoutPreviewContents(87, layout, true, index)} )} @@ -296,7 +296,7 @@ export class DocCreatorMenu extends ObservableReactComponent<{}> { } } - layoutPreviewContents = (outerSpan: number, altLayout?: DataVizTemplateLayout, zoomOption: boolean = true, small: boolean = false, id?: number) => { + layoutPreviewContents = (outerSpan: number, altLayout?: DataVizTemplateLayout, small: boolean = false, id?: number) => { const doc: Doc | undefined = altLayout ? altLayout.template : this._selectedTemplate; if (!doc) return; @@ -312,7 +312,7 @@ export class DocCreatorMenu extends ObservableReactComponent<{}> { return (
- {!zoomOption ? null :
+
-
} + {altLayout ? : null} +
{ } get optionsMenuContents(){ + const layoutEquals = (layout: DataVizTemplateLayout) => { + + } //TODO: ADD LATER + const layoutOption = (option: LayoutType, optStyle?: {}, specialFunc?: Function) => { return (
{ clickEv.stopPropagation(); if (!this._selectedTemplate) return; const layout: DataVizTemplateLayout = {template: this._selectedTemplate, layout: {type: this._layout.type, xMargin: this._layout.xMargin, yMargin:this._layout.yMargin, repeat: 0}, columns: this.columnsCount, rows: this.rowsCount, docsNumList: this.docsToRender}; - this._savedLayouts.push(layout); + if (!this._savedLayouts.includes(layout)) { this._savedLayouts.push(layout) }; }, 'make docs') ) }> -- cgit v1.2.3-70-g09d2