diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js index 39b60882d..2115452eb 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js @@ -864,7 +864,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' } }); this.btnSparkStyle.render($('#spark-dlg-button-style')); -// this.mnuSparkStylePicker.on('item:click', _.bind(this.onSelectSparkStyle, this, this.btnSparkStyle)); + this.mnuSparkStylePicker.on('item:click', _.bind(this.onSelectSparkStyle, this, this.btnSparkStyle)); this.radioGroup = new Common.UI.RadioBox({ el: $('#spark-dlg-radio-group'), @@ -1009,7 +1009,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' afterRender: function() { - if (this.api) + if (this.api && this.isChart) this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType)); this._setDefaults(this.chartSettings); @@ -1292,6 +1292,25 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' } }, + updateSparkStyles: function(styles) { + if (styles && styles.length>0){ + var stylesStore = this.mnuSparkStylePicker.store; + if (stylesStore) { + var stylearray = [], + selectedIdx = styles[styles.length-1]; + for (var i=0; i