refactoring of ComboBoxFonts
This commit is contained in:
parent
d1ea727e4c
commit
72f281abde
|
@ -188,12 +188,13 @@ define([
|
|||
|
||||
Common.NotificationCenter.on('menumanager:hideall', _.bind(me.closeMenu, me));
|
||||
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
|
||||
this.scroller = new Common.UI.Scroller(_.extend({
|
||||
el: $('.dropdown-menu', me.cmpEl),
|
||||
minScrollbarLength : 40,
|
||||
scrollYMarginOffset: 30,
|
||||
includePadding : true
|
||||
});
|
||||
}, this.options.scroller));
|
||||
|
||||
// set default selection
|
||||
this.setDefaultSelection();
|
||||
|
|
|
@ -86,10 +86,13 @@ define([
|
|||
initialize : function(options) {
|
||||
Common.UI.ComboBox.prototype.initialize.call(this, _.extend(options, {
|
||||
displayField: 'name'
|
||||
, scroller: {
|
||||
alwaysVisibleY: true,
|
||||
onChange: this.updateVisibleFontsTiles.bind(this)
|
||||
}
|
||||
}));
|
||||
|
||||
this.recent = _.isNumber(options.recent) ? options.recent : 3;
|
||||
this.bindUpdateVisibleFontsTiles = _.bind(this.updateVisibleFontsTiles, this);
|
||||
|
||||
Common.NotificationCenter.on('fonts:change', _.bind(this.onApiChangeFont, this));
|
||||
Common.NotificationCenter.on('fonts:load', _.bind(this.fillFonts, this));
|
||||
|
@ -109,7 +112,9 @@ define([
|
|||
this._input.on('keyup', _.bind(this.onInputKeyUp, this));
|
||||
this._input.on('keydown', _.bind(this.onInputKeyDown, this));
|
||||
|
||||
this.scroller.update({alwaysVisibleY: true, onChange:this.bindUpdateVisibleFontsTiles});
|
||||
setTimeout(function(me){
|
||||
me.scroller.update();
|
||||
}, 30, this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue