From 43ac070d1d89c08c3c66fab1673d1fb83e051d4d Mon Sep 17 00:00:00 2001 From: "Mahdi Cheikh Rouhou (macr)" Date: Tue, 13 Feb 2024 11:15:19 +0100 Subject: [PATCH] [FIX] web_editor: undo only table resize website editor Issue: ===== Undo of resize operation on table do 2 undos in a row. Steps to reproduce the issue: ============================= - Go to website editor - Add a text block - write `/table` to insert a table - Resize the table - Press `ctr+z` to undo - The table is removed Origin of the issue: ==================== The resize operation wasn't saved a step and is considered as draft then it will be discarded and then the undo applied on the last saved step that's why it appears as 2 undo in a row. Solution: ========= Call `historyStep` when we stop resizing. task-3743697 closes odoo/odoo#154402 X-original-commit: 836a68e29c8fa881854b19c7489086537127d4a3 Signed-off-by: Antoine Guenet (age) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 87b368ced4f..51fd586bb07 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -4675,6 +4675,7 @@ export class OdooEditor extends EventTarget { ev.preventDefault(); this._isResizingTable = false; this._toggleTableResizeCursor(false); + this.historyStep(); this.document.removeEventListener('mousemove', resizeTable); this.document.removeEventListener('mouseup', stopResizing); this.document.removeEventListener('mouseleave', stopResizing);