summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-05-29 19:02:43 +0200
committerChristophe Simonis <chs@odoo.com>2018-05-29 19:02:43 +0200
commit6be9593a0c0f43ad257ca94e22db77608faf7ae4 (patch)
treee64a4fe7265b01c2957953b3fc83615fec77485b /addons/web_editor/static/src
parentdbb2b9bf73d6722fa29540f2f15c583daa597d31 (diff)
parent459efb4276597108e9b4c7c96fb5e1e7cbb345a7 (diff)
[MERGE] forward port branch saas-14 up to 459efb42765
Diffstat (limited to 'addons/web_editor/static/src')
-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')