[FIX] web_editor: stop resetting bg image of parent snippet on color change

Commit 404ed0f788 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.
This commit is contained in:
qsm-odoo
2016-09-06 13:00:56 +02:00
parent 6e61ea2256
commit fa3f529d80
@@ -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;