Don't sort fonts

This commit is contained in:
Julia Radzhabova 2021-09-07 12:42:24 +03:00
parent c2aaf5a0f9
commit a7dad54f7b
6 changed files with 2 additions and 32 deletions

View file

@ -48,12 +48,6 @@ define([
'common/main/lib/model/Font' 'common/main/lib/model/Font'
], function(Backbone){ 'use strict'; ], function(Backbone){ 'use strict';
Common.Collections.Fonts = Backbone.Collection.extend({ Common.Collections.Fonts = Backbone.Collection.extend({
model: Common.Models.Font, model: Common.Models.Font
comparator: function(item1, item2) {
var n1 = item1.get('name').toLowerCase(),
n2 = item2.get('name').toLowerCase();
if (n1==n2) return 0;
return (n1<n2) ? -1 : 1;
}
}); });
}); });

View file

@ -120,11 +120,7 @@ define([
}); });
var store = this.getCollection('Common.Collections.Fonts'); var store = this.getCollection('Common.Collections.Fonts');
store && store.add(fontsArray);
if (store) {
store.add(fontsArray);
store.sort();
}
Common.NotificationCenter.trigger('fonts:load', store, select); Common.NotificationCenter.trigger('fonts:load', store, select);
} }

View file

@ -71,11 +71,6 @@ export class storeTextSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }
resetFontName (font) { resetFontName (font) {

View file

@ -75,11 +75,6 @@ export class storeTextSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }

View file

@ -139,11 +139,6 @@ export class storeCellSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }

View file

@ -78,11 +78,6 @@ export class storeTextSettings {
type : font.asc_getFontType() type : font.asc_getFontType()
}); });
} }
array.sort(function(a, b) {
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
});
this.fontsArray = array; this.fontsArray = array;
} }