From fa3f529d80b9b07b22c6b344df57b884fca23ea1 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 6 Sep 2016 13:00:56 +0200 Subject: [PATCH] [FIX] web_editor: stop resetting bg image of parent snippet on color change Commit 404ed0f7884ff724706e6d7f50d35482e92ce60a tried to solve the problem but only solved a part of it. Indeed, if the snippet child has a bg color option but not a bg image option, the event propagation stops in the parent handler, when it is too late. Solution is checking that the event comes from the same element on which the callback is attached to. --- addons/web_editor/static/src/js/snippets.options.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/snippets.options.js b/addons/web_editor/static/src/js/snippets.options.js index 996daee8753..f1cf4a47381 100644 --- a/addons/web_editor/static/src/js/snippets.options.js +++ b/addons/web_editor/static/src/js/snippets.options.js @@ -319,6 +319,7 @@ odoo.define('web_editor.snippets.options', function (require) { this.$target.off(".background-option") .on("background-color-event.background-option", (function (e, type) { e.stopPropagation(); + if (e.currentTarget !== e.target) return; this.$el.find("li:first > a").trigger(type); }).bind(this)); return res;