summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-05-29 18:45:00 +0200
committerChristophe Simonis <chs@odoo.com>2018-05-29 18:45:00 +0200
commit459efb4276597108e9b4c7c96fb5e1e7cbb345a7 (patch)
treea9a563b70c007a4c1d56a5c1b7c660ef5cf2e625 /addons/web_editor
parentcafe56da80838d597586ca0040aedf05ef0c4a72 (diff)
parent2288a89564c95c5060b5e783a00c9417bc74d687 (diff)
[MERGE] forward port branch 10.0 up to 2288a89564c
Diffstat (limited to 'addons/web_editor')
-rw-r--r--addons/web_editor/static/src/js/rte.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js
index 595602d6305..564857966b5 100644
--- a/addons/web_editor/static/src/js/rte.js
+++ b/addons/web_editor/static/src/js/rte.js
@@ -326,9 +326,12 @@ var RTE = Widget.extend({
});
// start element observation
- $(document).on('content_changed', '.o_editable', function (event) {
+ $(document).on('content_changed', '.o_editable', function (ev) {
self.trigger('change', this);
- $(this).addClass('o_dirty');
+ if (!ev.__isDirtyHandled) {
+ $(this).addClass('o_dirty');
+ ev.__isDirtyHandled = true;
+ }
});
$('#wrapwrap, .o_editable').on('click.rte', '*', this, this.onClick.bind(this));
@@ -357,6 +360,10 @@ var RTE = Widget.extend({
this.__saved = {}; // list of allready saved views and data
+
+ $('.o_editable')
+ .destroy()
+ .removeClass('o_editable o_is_inline_editable');
var defs = $('.o_dirty')
.removeAttr('contentEditable')
.removeClass('o_dirty oe_carlos_danger o_is_inline_editable')