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