scroller initialization moved on 'show:before'
This commit is contained in:
parent
00c2b4c767
commit
6ea59501e9
|
@ -188,14 +188,6 @@ define([
|
|||
|
||||
Common.NotificationCenter.on('menumanager:hideall', _.bind(me.closeMenu, me));
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
@ -233,6 +225,15 @@ define([
|
|||
},
|
||||
|
||||
onBeforeShowMenu: function(e) {
|
||||
if ( !this.scroller ) {
|
||||
this.scroller = new Common.UI.Scroller(_.extend({
|
||||
el: $('.dropdown-menu', this.cmpEl),
|
||||
minScrollbarLength: 40,
|
||||
scrollYMarginOffset: 30,
|
||||
includePadding: true
|
||||
}, this.options.scroller));
|
||||
}
|
||||
|
||||
Common.NotificationCenter.trigger('menu:show');
|
||||
this.trigger('show:before', this, e);
|
||||
if (this.options.hint) {
|
||||
|
|
|
@ -112,10 +112,6 @@ define([
|
|||
this._input.on('keyup', _.bind(this.onInputKeyUp, this));
|
||||
this._input.on('keydown', _.bind(this.onInputKeyDown, this));
|
||||
|
||||
setTimeout(function(me){
|
||||
me.scroller.update();
|
||||
}, 30, this);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue