diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index a47e0b976..7840c57ee 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -345,10 +345,9 @@ define([ var me = this; var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName()); if (this.__name !== name) { - this.__name = name; if (!this.__nameId) { this.__nameId = setTimeout(function () { - me.onApiChangeFontInternal(me.__name); + me.onApiChangeFontInternal(name); me.__nameId = null; }, 100); } @@ -358,6 +357,7 @@ define([ onApiChangeFontInternal: function(name) { if (this.inFormControl) return; + this.__name = name; if (this.getRawValue() !== name) { var record = this.store.findWhere({ name: name diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index e28e93882..0885beda8 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2038,10 +2038,7 @@ define([ val; /* read font name */ - var fontparam = fontobj.asc_getFontName(); - if (fontparam != toolbar.cmbFontName.getValue()) { - Common.NotificationCenter.trigger('fonts:change', fontobj); - } + Common.NotificationCenter.trigger('fonts:change', fontobj); /* read font params */ if (!toolbar.mode.isEditMailMerge && !toolbar.mode.isEditDiagram) { @@ -2153,10 +2150,7 @@ define([ val, need_disable = false; /* read font name */ - var fontparam = xfs.asc_getFontName(); - if (fontparam != toolbar.cmbFontName.getValue()) { - Common.NotificationCenter.trigger('fonts:change', xfs); - } + Common.NotificationCenter.trigger('fonts:change', xfs); /* read font size */ var str_size = xfs.asc_getFontSize(); @@ -2335,7 +2329,7 @@ define([ formatTableInfo = info.asc_getFormatTableInfo(); if (!toolbar.mode.isEditMailMerge) { /* read cell horizontal align */ - fontparam = xfs.asc_getHorAlign(); + var fontparam = xfs.asc_getHorAlign(); if (this._state.pralign !== fontparam) { this._state.pralign = fontparam;