From c25971dd82bd465c2f4da5b8d36b71108f5ea91f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 28 Jun 2017 16:12:57 +0300 Subject: [PATCH] [SSE] Fix Bug 34998. --- .../main/app/view/ChartSettings.js | 3 ++- .../main/app/view/ChartSettings.js | 3 ++- .../main/app/view/ChartSettings.js | 6 ++++-- .../main/app/view/ChartSettingsDlg.js | 16 ++++++++++++---- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index 0675f8bd9..fc567e365 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -145,7 +145,8 @@ define([ this.mnuChartTypePicker.selectRecord(record, true); if (record) { this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls')); - } + } else + this.btnChartType.setIconCls(''); this.updateChartStyles(this.api.asc_getChartPreviews(type)); this._state.ChartType = type; } diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index 71d966704..2f26d2942 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -128,7 +128,8 @@ define([ this.mnuChartTypePicker.selectRecord(record, true); if (record) { this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls')); - } + } else + this.btnChartType.setIconCls(''); this.updateChartStyles(this.api.asc_getChartPreviews(type)); this._state.ChartType = type; } diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index a31d09a2f..f93f2d047 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -160,7 +160,8 @@ define([ this.mnuChartTypePicker.selectRecord(record, true); if (record) { this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls')); - } + } else + this.btnChartType.setIconCls(''); this.updateChartStyles(this.api.asc_getChartPreviews(type)); this._state.ChartType = type; } @@ -226,7 +227,8 @@ define([ this.mnuSparkTypePicker.selectRecord(record, true); if (record) { this.btnSparkType.setIconCls('item-chartlist ' + record.get('iconCls')); - } + } else + this.btnSparkType.setIconCls(''); this._state.SparkType = type; styleChanged = true; } diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js index 0b6b7534d..86a93025b 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js @@ -1332,7 +1332,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' this.mnuChartTypePicker.selectRecord(record, true); if (record) { this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls')); - } + } else + this.btnChartType.setIconCls(''); this._noApply = false; @@ -1389,6 +1390,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' this.mnuSparkTypePicker.selectRecord(record, true); if (record) this.btnSparkType.setIconCls('item-chartlist ' + record.get('iconCls')); + else + this.btnSparkType.setIconCls(''); this.updateSparkStyles((this.sparklineStyles) ? this.sparklineStyles : props.asc_getStyles()); @@ -1443,10 +1446,12 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' }, getSettings: function() { - var value, - type = this.mnuChartTypePicker.getSelectedRec()[0].get('type'); + var value; if (this.isChart) { + var rec = this.mnuChartTypePicker.getSelectedRec(), + type = (rec && rec.length>0) ? rec[0].get('type') : this.currentChartType; + this.chartSettings.putType(type); this.chartSettings.putInColumns(this.cmbDataDirect.getValue()==1); @@ -1503,7 +1508,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' if (this.isChart) { var isvalid; if (!_.isEmpty(this.txtDataRange.getValue())) { - isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, this.mnuChartTypePicker.getSelectedRec()[0].get('type')); + var rec = this.mnuChartTypePicker.getSelectedRec(), + type = (rec && rec.length>0) ? rec[0].get('type') : this.currentChartType; + + isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, type); if (isvalid == Asc.c_oAscError.ID.No) return true; } else