[IMP] web_editor: put rollback code assignation on its own line

If the `_toRollback` property of the editor is assigned on its own line, it is
easier to identify which assignation caused/prevented a rollback when
debugging.

closes odoo/odoo#130894

X-original-commit: 263dcbaf9aa0c48bd61bf85b091c746d7850cfe1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
abd-msyukyu-odoo
2023-08-04 16:35:12 +02:00
parent 7100f014cf
commit 5feda35e6f
@@ -964,9 +964,9 @@ export class OdooEditor extends EventTarget {
}
case 'childList': {
record.addedNodes.forEach(added => {
this._toRollback =
this._toRollback ||
(containsUnremovable(added) && UNREMOVABLE_ROLLBACK_CODE);
if (!this._toRollback && containsUnremovable(added)) {
this._toRollback = UNREMOVABLE_ROLLBACK_CODE;
}
const mutation = {
'type': 'add',
};
@@ -1486,8 +1486,9 @@ export class OdooEditor extends EventTarget {
}
}
unbreakableStepUnactive() {
this._toRollback =
this._toRollback === UNBREAKABLE_ROLLBACK_CODE ? false : this._toRollback;
if (this._toRollback === UNBREAKABLE_ROLLBACK_CODE) {
this._toRollback = false;
}
this._checkStepUnbreakable = false;
}
historyPauseSteps() {