[FIX] website: editor: enable/disable save/undo/redo button when resize snippet
This commit is contained in:
@@ -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());
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user