mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
bf9721bf40
commit
227802b83c
1 changed files with 19 additions and 10 deletions
|
@ -48,6 +48,7 @@ import {getAllModels} from "../layout/getAll";
|
|||
import {isSupportCSSHL} from "./render/searchMarkRender";
|
||||
import {renderAVAttribute} from "./render/av/blockAttr";
|
||||
import {genEmptyElement} from "../block/util";
|
||||
import {zoomOut} from "../menus/protyle";
|
||||
|
||||
export class Protyle {
|
||||
|
||||
|
@ -179,6 +180,13 @@ export class Protyle {
|
|||
// 反链面板移除元素后,文档为空
|
||||
if (this.protyle.wysiwyg.element.childElementCount === 0 && this.protyle.block.parentID &&
|
||||
!(item.action === "delete" && typeof item.data?.createEmptyParagraph === "boolean" && !item.data.createEmptyParagraph)) {
|
||||
if (item.action === "delete" && this.protyle.block.showAll) {
|
||||
zoomOut({
|
||||
protyle: this.protyle,
|
||||
id: this.protyle.block.rootID,
|
||||
focusId: this.protyle.block.id
|
||||
});
|
||||
} else {
|
||||
const newID = Lute.NewNodeID();
|
||||
const emptyElement = genEmptyElement(false, false, newID);
|
||||
this.protyle.wysiwyg.element.append(emptyElement);
|
||||
|
@ -191,6 +199,7 @@ export class Protyle {
|
|||
this.protyle.undo.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "readonly":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue