scroller initialization moved on 'show:before'

This commit is contained in:
Maxim Kadushkin 2016-08-05 12:59:38 +03:00
parent 00c2b4c767
commit 6ea59501e9
2 changed files with 9 additions and 12 deletions

View file

@ -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) {

View file

@ -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;
},