Files
odoo_source/addons/web_editor/static
Soukéina Bojabza a015f17ce6 [FIX] web_editor: prevent recording the o_draggable class changes
Since commit [1], which removed jQueryUI for the drag and drop, the
history when editing breaks easily.

Steps to reproduce:
- Drag and drop "Text-Image", save and go back to edit mode.
- Click on a column, move it to the right using the arrow and then to
  the left, still with the arrow.
- Undo: no issue, the column went to the right.
- Undo: nothing changed => the column should have gone to the left.
- Undo: the column goes to the left => there should not be a third undo
  since we only did two changes. 
- Redo: no issue, the column goes to right.
- Redo: nothing changed => the column should have gone to the left.
- Nothing to redo anymore => the column never goes to the left again.

This happens because with the new drag and drop, an `o_draggable` class
is added on the elements when their editor are started, which adds
mutations in the history. Even though it does not explicitely add a
step, these mutations are well reverted when undoing/redoing (e.g. this
is what happens when nothing changes in the steps to reproduce).

This commit fixes this history issue by ignoring the mutations linked to
the `o_draggable` class.

Note that commit [2] already fixed other `o_draggable` class issues.
This commit therefore fixes them in a more general way.

[1]: https://github.com/odoo/odoo/commit/7594d71ca8610d5947e80f325ccb57abc23c2c76
[2]: https://github.com/odoo/odoo/commit/32a6729dd094d53eb4a653ebb9d69d2b8cbe2390

task-3698536

closes odoo/odoo#150687

Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2024-02-06 14:29:02 +00:00
..