From 92379a3a2da47f73495d0654d1b2252cb8a0eb54 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 24 Mar 2022 12:34:07 +0300 Subject: [PATCH] Fix open diagram editor (when right panel in sse is closed) --- apps/documenteditor/main/app/view/ChartSettings.js | 2 ++ apps/documenteditor/main/app/view/TableSettings.js | 4 ++-- apps/presentationeditor/main/app/view/ChartSettings.js | 2 ++ apps/presentationeditor/main/app/view/TableSettings.js | 4 ++-- apps/spreadsheeteditor/main/app/view/ChartSettings.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index b97bcb5b1..09b25f1fe 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -444,6 +444,8 @@ define([ }, onAddChartStylesPreview: function(styles){ + if (!this.cmbChartStyle) return; + var me = this; if (styles && styles.length>0){ var stylesStore = this.cmbChartStyle.menuPicker.store; diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 864408c8e..7b5b4bba1 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -794,9 +794,9 @@ define([ }); if (this._state.beginPreviewStyles) { this._state.beginPreviewStyles = false; - self.mnuTableTemplatePicker.store.reset(arr); + self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(arr); } else - self.mnuTableTemplatePicker.store.add(arr); + self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.add(arr); !this._state.currentStyleFound && this.selectCurrentTableStyle(); }, diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index bb7c36b7e..fe0fe252f 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -385,6 +385,8 @@ define([ }, onAddChartStylesPreview: function(styles){ + if (!this.cmbChartStyle) return; + var me = this; if (styles && styles.length>0){ var stylesStore = this.cmbChartStyle.menuPicker.store; diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js index 744cb00a8..26bbd7a24 100644 --- a/apps/presentationeditor/main/app/view/TableSettings.js +++ b/apps/presentationeditor/main/app/view/TableSettings.js @@ -726,9 +726,9 @@ define([ }); if (this._state.beginPreviewStyles) { this._state.beginPreviewStyles = false; - self.mnuTableTemplatePicker.store.reset(arr); + self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.reset(arr); } else - self.mnuTableTemplatePicker.store.add(arr); + self.mnuTableTemplatePicker && self.mnuTableTemplatePicker.store.add(arr); !this._state.currentStyleFound && this.selectCurrentTableStyle(); }, diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index 39a6200f7..b76290e16 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -994,7 +994,7 @@ define([ }, onAddChartStylesPreview: function(styles){ - if (this._isEditType) return; + if (this._isEditType || !this.cmbChartStyle) return; if (styles && styles.length>0){ var stylesStore = this.cmbChartStyle.menuPicker.store;