Commit 6ea59501 authored by Maxim Kadushkin's avatar Maxim Kadushkin

scroller initialization moved on 'show:before'

parent 00c2b4c7
......@@ -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;
},
......
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