diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 01020a84c22..094d13340dc 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -764,7 +764,7 @@ eventHandler.attach = function (oLayoutInfo, options) { .add(oLayoutInfo.handle()) .add(oLayoutInfo.popover()) .add(custom_toolbar) - .on('click keyup', function () { + .on('click content_changed', function () { $('button[data-event="undo"]', $toolbar).attr('disabled', !oLayoutInfo.editable().data('NoteHistory').hasUndo()); $('button[data-event="redo"]', $toolbar).attr('disabled', !oLayoutInfo.editable().data('NoteHistory').hasRedo()); }); diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 6015f740301..0da262f145e 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -326,7 +326,9 @@ options.registry.marginAndResize = options.Class.extend({ $body.removeClass(cursor); setTimeout(function () { self.buildingBlock.editor_busy = false; - self.$target.closest(".o_editable").trigger("content_changed"); + if (begin !== current) { + self.buildingBlock.parent.rte.historyRecordUndo(self.$target, 'resize_' + XY); + } },0); self.$target.removeClass("resize_editor_busy"); }; @@ -336,8 +338,8 @@ options.registry.marginAndResize = options.Class.extend({ this.$overlay.find(".oe_handle.size .auto_size").on('click', function (event){ self.$target.css("height", ""); self.$target.css("overflow", ""); + self.buildingBlock.parent.rte.historyRecordUndo(self.$target, 'resize_Y'); self.buildingBlock.cover_target(self.$overlay, self.$target); - self.$target.closest(".o_editable").trigger("content_changed"); return false; }); },