From 0f45436c9ccea6ea1d9c14e20179a51cd0aa11bb Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 7 Dec 2016 10:44:28 +0100 Subject: [PATCH] [FIX] web_tip: do not off all the bus "resize" events The Tip class instances are binding two callbacks to the core.bus "resize" event: one in the init function and one when the tip is triggered. In the destroy function, these two bindings are removed. However, if the tip was not triggered, the second binding has not been made and removing it in the destroy function removed every bindings made on the core.bus "resize" event instead (even those from other modules). This is because it gives an undefined callback and so this is equivalent to calling bus.off("resize", this[, undefined]). Note: this problem is solved in future versions with the new web_tour module. --- addons/web_tip/static/src/js/tip.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_tip/static/src/js/tip.js b/addons/web_tip/static/src/js/tip.js index 416598277ba..abaaa59a8fc 100644 --- a/addons/web_tip/static/src/js/tip.js +++ b/addons/web_tip/static/src/js/tip.js @@ -315,7 +315,9 @@ var Tip = Class.extend({ }); $(document).off('keyup.web_tip'); - bus.off('resize', this, this._resize_position); + if (this._resize_position) { + bus.off('resize', this, this._resize_position); + } bus.off('resize', this, this._resize); bus.off('image_loaded', this, this._resize); bus.off('please_reposition_tip', this, this._resize);