diff options
| author | Christophe Matthieu <chm@odoo.com> | 2015-08-26 10:10:01 +0200 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2015-08-26 16:01:18 +0200 |
| commit | 8eb8a982f9627c8d2cccf5d6b8241eec011e03e2 (patch) | |
| tree | f03a41b74a75d0f83d64d19aa9c49f7d4f0a98dc /addons/web_editor/static/src/js/snippets.editor.js | |
| parent | ea26a62712ae9875f845b245f1f6c99df5d5d32a (diff) | |
[FIX] web_editor: clean_for_save all dirty options
Clean for save was only called on o_dirty nodes but o_dirty is added only on o_editable nodes.
Could use a simple jQuery selector '.o_dirty, .o_dirty *' but need to improve speed for user experience.
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.editor.js')
| -rw-r--r-- | addons/web_editor/static/src/js/snippets.editor.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js index 3de9b71d5f8..5bc2f2aa4ad 100644 --- a/addons/web_editor/static/src/js/snippets.editor.js +++ b/addons/web_editor/static/src/js/snippets.editor.js @@ -507,7 +507,13 @@ var BuildingBlock = Widget.extend({ for (var k in template) { var Option = opt[template[k]['option']]; if (Option && Option.prototype.clean_for_save !== dummy) { - template[k].selector.all().filter(".o_dirty").each(function () { + template[k].selector.all().filter(function () { + var node = this; + while (!/o_dirty|o_editable/.test(node.className) && node !== document) { + node = node.parentNode; + } + return node.className.indexOf("o_dirty") !== -1; + }).each(function () { new Option(self, null, $(this), k).clean_for_save(); }); } |
