fix issue with undo because this.elem was overwritten with node.remove()

This commit is contained in:
JFH
2020-06-28 21:52:27 +02:00
parent 18d73cfefa
commit 61591f6a2e
4 changed files with 33 additions and 6 deletions

View File

@@ -223,7 +223,7 @@ export class InsertElementCommand extends Command {
}
this.parent = this.elem.parentNode;
this.elem = this.elem.remove();
this.elem.remove();
if (handler) {
handler.handleHistoryEvent(HistoryEventTypes.AFTER_UNAPPLY, this);
@@ -280,7 +280,7 @@ export class RemoveElementCommand extends Command {
removeElementFromListMap(this.elem);
this.parent = this.elem.parentNode;
this.elem = this.elem.remove();
this.elem.remove();
if (handler) {
handler.handleHistoryEvent(HistoryEventTypes.AFTER_APPLY, this);