Merge pull request #203 from ONLYOFFICE/feature/sse-currency-formats
Feature/sse currency formats
This commit is contained in:
commit
599d2a2838
|
@ -1089,13 +1089,30 @@ define([
|
||||||
|
|
||||||
onNumberFormatMenu: function(menu, item) {
|
onNumberFormatMenu: function(menu, item) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
var info = new Asc.asc_CFormatCellsInfo();
|
if (item.value == -1) {
|
||||||
info.asc_setType(Asc.c_oAscNumFormatType.Accounting);
|
// show more formats
|
||||||
info.asc_setSeparator(false);
|
if (this._state.numformatinfo && this._state.numformatinfo.asc_getType()==Asc.c_oAscNumFormatType.Accounting)
|
||||||
info.asc_setSymbol(item.value);
|
this.onCustomNumberFormat();
|
||||||
var format = this.api.asc_getFormatCells(info);
|
else {
|
||||||
if (format && format.length>0)
|
var value = this.api.asc_getLocale();
|
||||||
this.api.asc_setCellFormat(format[0]);
|
(!value) && (value = ((this.toolbar.mode.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.toolbar.mode.lang)) : 0x0409));
|
||||||
|
|
||||||
|
var info = new Asc.asc_CFormatCellsInfo();
|
||||||
|
info.asc_setType(Asc.c_oAscNumFormatType.Accounting);
|
||||||
|
info.asc_setSeparator(false);
|
||||||
|
info.asc_setSymbol(value);
|
||||||
|
var format = this.api.asc_getFormatCells(info);
|
||||||
|
this.onCustomNumberFormat((format && format.length>0) ? format[0] : undefined, info);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var info = new Asc.asc_CFormatCellsInfo();
|
||||||
|
info.asc_setType(Asc.c_oAscNumFormatType.Accounting);
|
||||||
|
info.asc_setSeparator(false);
|
||||||
|
info.asc_setSymbol(item.value);
|
||||||
|
var format = this.api.asc_getFormatCells(info);
|
||||||
|
if (format && format.length>0)
|
||||||
|
this.api.asc_setCellFormat(format[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
|
@ -1113,7 +1130,7 @@ define([
|
||||||
Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
|
Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
|
||||||
},
|
},
|
||||||
|
|
||||||
onCustomNumberFormat: function() {
|
onCustomNumberFormat: function(format, formatInfo) {
|
||||||
var me = this,
|
var me = this,
|
||||||
value = me.api.asc_getLocale();
|
value = me.api.asc_getLocale();
|
||||||
(!value) && (value = ((me.toolbar.mode.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.toolbar.mode.lang)) : 0x0409));
|
(!value) && (value = ((me.toolbar.mode.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(me.toolbar.mode.lang)) : 0x0409));
|
||||||
|
@ -1126,7 +1143,7 @@ define([
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
},
|
},
|
||||||
props : {format: me._state.numformat, formatInfo: me._state.numformatinfo, langId: value}
|
props : {format: format ? format : me._state.numformat, formatInfo: formatInfo ? formatInfo : me._state.numformatinfo, langId: value}
|
||||||
})).show();
|
})).show();
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
|
Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
|
||||||
|
|
|
@ -833,6 +833,10 @@ define([
|
||||||
{
|
{
|
||||||
caption : me.txtYen,
|
caption : me.txtYen,
|
||||||
value : 0x0411 // ¥ ja-JP
|
value : 0x0411 // ¥ ja-JP
|
||||||
|
},{caption: '--'},
|
||||||
|
{
|
||||||
|
caption : me.textMoreFormats,
|
||||||
|
value : -1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue