mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-10-03 00:28:42 +08:00
fix(editor): 新增删除页面不应该添加历史
This commit is contained in:
parent
2bbca87e51
commit
3e78a0809b
@ -375,7 +375,9 @@ class Editor extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isPage(newNodes[0])) {
|
||||||
this.pushHistoryState();
|
this.pushHistoryState();
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('add', newNodes);
|
this.emit('add', newNodes);
|
||||||
|
|
||||||
@ -437,8 +439,10 @@ class Editor extends BaseService {
|
|||||||
|
|
||||||
await Promise.all(nodes.map((node) => this.doRemove(node)));
|
await Promise.all(nodes.map((node) => this.doRemove(node)));
|
||||||
|
|
||||||
|
if (!isPage(nodes[0])) {
|
||||||
// 更新历史记录
|
// 更新历史记录
|
||||||
this.pushHistoryState();
|
this.pushHistoryState();
|
||||||
|
}
|
||||||
|
|
||||||
this.emit('remove', nodes);
|
this.emit('remove', nodes);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user