summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/snippets.options.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-09-06 13:00:56 +0200
committerqsm-odoo <qsm@odoo.com>2016-09-06 13:00:56 +0200
commitfa3f529d80b9b07b22c6b344df57b884fca23ea1 (patch)
tree62d42f5bcff5731d8e2fa11c31cf61ba906ea5ba /addons/web_editor/static/src/js/snippets.options.js
parent6e61ea22561d22d241e6271f803fb5bdd1defcca (diff)
[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.
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.options.js')
-rw-r--r--addons/web_editor/static/src/js/snippets.options.js1
1 files changed, 1 insertions, 0 deletions
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;