[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) <age@odoo.com>
This commit is contained in:
Mahdi Cheikh Rouhou (macr)
2024-02-19 09:06:54 +00:00
parent 40b99b686d
commit 43ac070d1d
@@ -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);