initialize scroller before the menu opened

This commit is contained in:
Maxim Kadushkin 2016-08-04 20:00:42 +03:00
parent bab0bfc3ba
commit e719bb3f52

View file

@ -727,13 +727,15 @@ define([
items: [], items: [],
maxHeight : 600, maxHeight : 600,
restoreHeight: 600 restoreHeight: 600
}).on('render:after', function(mnu) { }).on('show:before', function(mnu) {
this.scroller = new Common.UI.Scroller({ if ( !this.scroller ) {
el: $(this.el).find('.dropdown-menu '), this.scroller = new Common.UI.Scroller({
useKeyboard: this.enableKeyEvents && !this.handleSelect, el: $(this.el).find('.dropdown-menu '),
minScrollbarLength : 40, useKeyboard: this.enableKeyEvents && !this.handleSelect,
alwaysVisibleY: true minScrollbarLength: 40,
}); alwaysVisibleY: true
});
}
}).on('show:after', function(btn, e) { }).on('show:after', function(btn, e) {
var mnu = $(this.el).find('.dropdown-menu '), var mnu = $(this.el).find('.dropdown-menu '),
docH = $(document).height(), docH = $(document).height(),
@ -1549,7 +1551,7 @@ define([
this.mnuColorSchema = new Common.UI.Menu({ this.mnuColorSchema = new Common.UI.Menu({
maxHeight : 600, maxHeight : 600,
restoreHeight: 600 restoreHeight: 600
}).on('render:after', function(mnu) { }).on('show:before', function(mnu) {
this.scroller = new Common.UI.Scroller({ this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '), el: $(this.el).find('.dropdown-menu '),
useKeyboard: this.enableKeyEvents && !this.handleSelect, useKeyboard: this.enableKeyEvents && !this.handleSelect,