Merge pull request #561 from ONLYOFFICE/feature/improve-comboboxfont-performance
Improve performance
This commit is contained in:
commit
55e3b583c7
|
@ -341,16 +341,21 @@ define([
|
||||||
|
|
||||||
onApiChangeFont: function(font) {
|
onApiChangeFont: function(font) {
|
||||||
var me = this;
|
var me = this;
|
||||||
setTimeout(function () {
|
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
|
||||||
me.onApiChangeFontInternal(font);
|
if (this.__name !== name) {
|
||||||
}, 100);
|
this.__name = name;
|
||||||
|
if (!this.__nameId) {
|
||||||
|
this.__nameId = setTimeout(function () {
|
||||||
|
me.onApiChangeFontInternal(me.__name);
|
||||||
|
me.__nameId = null;
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiChangeFontInternal: function(font) {
|
onApiChangeFontInternal: function(name) {
|
||||||
if (this.inFormControl) return;
|
if (this.inFormControl) return;
|
||||||
|
|
||||||
var name = (_.isFunction(font.get_Name) ? font.get_Name() : font.asc_getFontName());
|
|
||||||
|
|
||||||
if (this.getRawValue() !== name) {
|
if (this.getRawValue() !== name) {
|
||||||
var record = this.store.findWhere({
|
var record = this.store.findWhere({
|
||||||
name: name
|
name: name
|
||||||
|
|
Loading…
Reference in a new issue