[SSE] FormatSettingsDialog: add custom format to the list of formats.
This commit is contained in:
parent
ad8c469c21
commit
973b55315d
|
@ -104,6 +104,7 @@ define([
|
|||
multiselect: false,
|
||||
sparklines_disabled: false,
|
||||
numformattype: undefined,
|
||||
numformat: undefined,
|
||||
langId: undefined
|
||||
};
|
||||
|
||||
|
@ -908,7 +909,7 @@ define([
|
|||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
},
|
||||
props : {formatType: me._state.numformattype, langId: value}
|
||||
props : {formatType: me._state.numformattype, format: me._state.numformat, langId: value}
|
||||
})).show();
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
|
||||
|
@ -1935,6 +1936,7 @@ define([
|
|||
}
|
||||
|
||||
val = info.asc_getNumFormatType();
|
||||
this._state.numformat = info.asc_getNumFormat();
|
||||
if (this._state.numformattype !== val) {
|
||||
toolbar.cmbNumberFormat.setValue(val, toolbar.txtCustom);
|
||||
this._state.numformattype = val;
|
||||
|
|
|
@ -162,6 +162,7 @@ define([
|
|||
|
||||
this.FormatType = Asc.c_oAscNumFormatType.General;
|
||||
this.Format = "General";
|
||||
this.CustomFormat = null;
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
@ -262,6 +263,9 @@ define([
|
|||
this.langId = props.langId;
|
||||
this.cmbFormat.setValue(props.formatType, this.txtCustom);
|
||||
|
||||
if ((props.formatType == Asc.c_oAscNumFormatType.Custom) && props.format)
|
||||
this.CustomFormat = this.Format = props.format;
|
||||
|
||||
this.onFormatSelect(this.cmbFormat, this.cmbFormat.getSelectedRecord());
|
||||
// for fraction - if props.format not in cmbType - setValue(this.txtCustom)
|
||||
// for date/time - if props.format not in cmbType - setValue(this.api.asc_getLocaleExample(props.format, 37973))
|
||||
|
@ -433,10 +437,16 @@ define([
|
|||
info.asc_setSymbol(this.langId);
|
||||
|
||||
var formatsarr = this.api.asc_getFormatCells(info),
|
||||
data = [];
|
||||
data = [],
|
||||
isCustom = (this.CustomFormat) ? true : false;
|
||||
formatsarr.forEach(function(item) {
|
||||
data.push({value: item, displayValue: item});
|
||||
if (me.CustomFormat == item)
|
||||
isCustom = false;
|
||||
});
|
||||
if (isCustom) {
|
||||
data.push({value: this.CustomFormat, displayValue: this.CustomFormat});
|
||||
}
|
||||
this.cmbCode.setData(data);
|
||||
this.cmbCode.setValue(this.Format);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue