[FIX] web_editor: apply o_dirty class on change

Before: if a user blur a editable area without editing, the editor is removed and all bind are remove.
The 'content_changed' bind are removed and the 'o_dirty' class is never apply.
This commit is contained in:
Christophe Matthieu
2015-09-25 16:06:21 +02:00
parent 743f26a796
commit 4ba0232bf8
+5 -6
View File
@@ -316,16 +316,15 @@ var RTE = Widget.extend({
$node.addClass('o_is_inline_editable');
}
// start element observation
$node.one('content_changed', function () {
$(this).addClass('o_dirty');
});
$node.data('initInnerHTML', $node.html());
});
$(document).on('content_changed', '.o_editable', function () {
// start element observation
$(document).on('content_changed', '.o_editable', function (event) {
self.trigger('change', this);
if(!$(this).hasClass('o_dirty')) {
$(this).addClass('o_dirty');
}
});
$('#wrapwrap, .o_editable').on('click', '*', this, this.onClick);