summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-12-19 10:35:57 +0100
committerFabien Meghazi <fme@openerp.com>2012-12-19 10:35:57 +0100
commit7fc896564b9ebd640119dc4a5b654a19c8d8bc1f (patch)
tree74765153cf867052ee279cd6d34445fc5443fcee /addons/web/static
parentfe843951277f772988571dcfec7825b76e3bcf5d (diff)
[IMP] Use _.debounce helper for lazy reflow
bzr revid: fme@openerp.com-20121219093557-g1of11sh45rn05xg
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/chrome.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 3812a00d8f3..ffc98693470 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -813,18 +813,8 @@ instance.web.Menu = instance.web.Widget.extend({
});
}
});
- var resizing_timer = null;
- instance.web.bus.on('resize', this, function(ev) {
- if (resizing_timer) {
- clearTimeout(resizing_timer);
- } else {
- self.$el.hide();
- }
- resizing_timer = setTimeout(function() {
- self.reflow();
- resizing_timer = null;
- }, 300);
- });
+ var lazyreflow = _.debounce(this.reflow.bind(this), 300);
+ instance.web.bus.on('resize', this, lazyreflow);
},
start: function() {
this._super.apply(this, arguments);