From 2e34d7b1f03967c26596f2afd1e8e0f88299a495 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 27 Sep 2016 16:20:55 +0300 Subject: [PATCH] [SSE] Update sparkline styles in advanced settings. --- .../main/app/view/ChartSettingsDlg.js | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) 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