commit
e60b20590e
|
@ -48,12 +48,6 @@ define([
|
|||
'common/main/lib/model/Font'
|
||||
], function(Backbone){ 'use strict';
|
||||
Common.Collections.Fonts = Backbone.Collection.extend({
|
||||
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;
|
||||
}
|
||||
model: Common.Models.Font
|
||||
});
|
||||
});
|
||||
|
|
|
@ -53,12 +53,13 @@ define([
|
|||
iconHeight = Asc.FONT_THUMBNAIL_HEIGHT || 28,
|
||||
thumbCanvas = document.createElement('canvas'),
|
||||
thumbContext = thumbCanvas.getContext('2d'),
|
||||
postfix = (/^(zh|ja|ko)$/i.test(Common.Locale.getCurrentLanguage())) ? '_ea' : '',
|
||||
thumbs = [
|
||||
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail.png', width: iconWidth, height: iconHeight},
|
||||
{ratio: 1.25, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: iconWidth * 1.25, height: iconHeight * 1.25},
|
||||
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
|
||||
{ratio: 1.75, path: '../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: iconWidth * 1.75, height: iconHeight * 1.75},
|
||||
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: iconWidth * 2, height: iconHeight * 2}
|
||||
{ratio: 1, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '.png', width: iconWidth, height: iconHeight},
|
||||
{ratio: 1.25, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.25x.png', width: iconWidth * 1.25, height: iconHeight * 1.25},
|
||||
{ratio: 1.5, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.5x.png', width: iconWidth * 1.5, height: iconHeight * 1.5},
|
||||
{ratio: 1.75, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@1.75x.png', width: iconWidth * 1.75, height: iconHeight * 1.75},
|
||||
{ratio: 2, path: '../../../../sdkjs/common/Images/fonts_thumbnail' + postfix + '@2x.png', width: iconWidth * 2, height: iconHeight * 2}
|
||||
],
|
||||
thumbIdx = 0,
|
||||
listItemHeight = 28,
|
||||
|
|
|
@ -120,11 +120,7 @@ define([
|
|||
});
|
||||
|
||||
var store = this.getCollection('Common.Collections.Fonts');
|
||||
|
||||
if (store) {
|
||||
store.add(fontsArray);
|
||||
store.sort();
|
||||
}
|
||||
store && store.add(fontsArray);
|
||||
|
||||
Common.NotificationCenter.trigger('fonts:load', store, select);
|
||||
}
|
||||
|
|
|
@ -71,11 +71,6 @@ export class storeTextSettings {
|
|||
type : font.asc_getFontType()
|
||||
});
|
||||
}
|
||||
|
||||
array.sort(function(a, b) {
|
||||
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
|
||||
});
|
||||
|
||||
this.fontsArray = array;
|
||||
}
|
||||
resetFontName (font) {
|
||||
|
|
|
@ -75,11 +75,6 @@ export class storeTextSettings {
|
|||
type : font.asc_getFontType()
|
||||
});
|
||||
}
|
||||
|
||||
array.sort(function(a, b) {
|
||||
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
|
||||
});
|
||||
|
||||
this.fontsArray = array;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,11 +139,6 @@ export class storeCellSettings {
|
|||
type : font.asc_getFontType()
|
||||
});
|
||||
}
|
||||
|
||||
array.sort(function(a, b) {
|
||||
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
|
||||
});
|
||||
|
||||
this.fontsArray = array;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,11 +78,6 @@ export class storeTextSettings {
|
|||
type : font.asc_getFontType()
|
||||
});
|
||||
}
|
||||
|
||||
array.sort(function(a, b) {
|
||||
return (a.name.toLowerCase() > b.name.toLowerCase()) ? 1 : -1;
|
||||
});
|
||||
|
||||
this.fontsArray = array;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue