Commit 72f281ab authored by Maxim Kadushkin's avatar Maxim Kadushkin

refactoring of ComboBoxFonts

parent d1ea727e
......@@ -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;
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment