diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 80ef9a849f5..e89266d6cf3 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1292,7 +1292,7 @@ define(['summernote/summernote'], function () { setTimeout(function () {$destroy.destroy();},150); // setTimeout to remove flickering when change to editable zone (re-create an editor) $last = null; } - if ($editable.size() && (!$last || $last[0] != $editable[0]) && + if ($editable.not('.o_skip_rte').size() && (!$last || $last[0] != $editable[0]) && ($target.closest('[contenteditable]').attr('contenteditable') || "").toLowerCase() !== 'false') { $editable.summernote(self._config()); $editable.data('NoteHistory', self.history); diff --git a/addons/website/static/src/js/website.translator.js b/addons/website/static/src/js/website.translator.js index 919c47a9531..2389fef860d 100644 --- a/addons/website/static/src/js/website.translator.js +++ b/addons/website/static/src/js/website.translator.js @@ -34,24 +34,25 @@ edit: function () { var self = this; var mysuper = this._super; + var $editables = $('[data-oe-model]:not([data-oe-type="html"])').addClass('o_skip_rte'); if (!localStorage[nodialog]) { var dialog = new website.TranslatorDialog(); dialog.appendTo($(document.body)); dialog.on('activate', this, function () { localStorage[nodialog] = dialog.$('input[name=do_not_show]').prop('checked') || ''; dialog.$el.modal('hide'); + mysuper.call(self, !$('[data-oe-type="html"]').length); self.translate().then(function () { - mysuper.call(self, true); if(self.gengo_translate){ - self.translation_gengo_display() + self.translation_gengo_display(); } }); }); } else { + mysuper.call(self, !$('[data-oe-type="html"]').length); this.translate().then(function () { - mysuper.call(self, true); if(self.gengo_translate){ - self.translation_gengo_display() + self.translation_gengo_display(); } }); } @@ -153,7 +154,9 @@ var self = this; var trans = {}; // this._super.apply(this, arguments); - $('.oe_translatable_text.o_dirty').each(function () { + $('.oe_translatable_text.o_dirty').filter(function () { + return self.getInitialContent(this) !== $(this).text(); + }).each(function () { var $node = $(this); var data = $node.data(); if (!trans[data.oeTranslationViewId]) {