[IMP] Take menu out of the rendering flow during the window resize

bzr revid: fme@openerp.com-20121219095550-8imsql4rl4up1hw2
This commit is contained in:
Fabien Meghazi 2012-12-19 10:55:50 +01:00
parent 7fc896564b
commit 0272bd4aec
1 changed files with 6 additions and 3 deletions

View File

@ -813,8 +813,11 @@ instance.web.Menu = instance.web.Widget.extend({
});
}
});
var lazyreflow = _.debounce(this.reflow.bind(this), 300);
instance.web.bus.on('resize', this, lazyreflow);
var lazyreflow = _.debounce(this.reflow.bind(this), 200);
instance.web.bus.on('resize', this, function() {
self.$el.height(0);
lazyreflow();
});
},
start: function() {
this._super.apply(this, arguments);
@ -859,7 +862,7 @@ instance.web.Menu = instance.web.Widget.extend({
*/
reflow: function() {
var self = this;
this.$el.show();
this.$el.height('auto').show();
var $more_container = this.$('.oe_menu_more_container').hide();
var $more = this.$('.oe_menu_more');
$more.children('li').insertBefore($more_container);