From a5aadac49d3a5931c3139b90adb8e3e09a8cb707 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Dec 2020 12:09:16 +0300 Subject: [PATCH] [SSE] Fix format settings for axis --- .../main/app/view/ChartSettingsDlg.js | 2 +- .../main/app/view/FormatSettingsDialog.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js index 6fd5f62d4..4c4e8a1f4 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js @@ -1700,7 +1700,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' } }, linked: true, - props : {format: fmt.getFormatCode(), formatInfo: fmt.getFormatCellsInfo(), langId: value, linked: fmt.getSourceLinked()} + props : {format: fmt.getFormatCode(), formatInfo: fmt.getFormatCellsInfo(), langId: value, chartFormat: fmt} })).on('close', function() { me._isEditFormat && me.chartSettings.cancelEditData(); me._isEditFormat = false; diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index 2c50c7028..f2690df99 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -262,8 +262,13 @@ define([ el: $('#format-settings-chk-linked'), labelText: this.textLinked }).on ('change', function (field, newValue, oldValue, eOpts) { - if (field.getValue()=='checked') + me.props.linked = (field.getValue()=='checked'); + if (me.props.linked) { + me.props.chartFormat.putSourceLinked(true); + me.props.format = me.props.chartFormat.getFormatCode(); + me.props.formatInfo = me.props.chartFormat.getFormatCellsInfo(); me._setDefaults(me.props); + } }); this.chLinked.setVisible(this.linked); @@ -339,7 +344,9 @@ define([ // for date/time - if props.format not in cmbType - setValue(this.api.asc_getLocaleExample(props.format, 38822)) // for cmbNegative - if props.format not in cmbNegative - setValue(this.api.asc_getLocaleExample(props.format)) } - props && this.chLinked.setValue(!!props.linked, true); + if (props && props.chartFormat) { + this.chLinked.setValue(!!props.chartFormat.getSourceLinked(), true); + } }, getSettings: function () {