mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
61bc821754
commit
381a7b88ff
2 changed files with 11 additions and 5 deletions
|
@ -179,11 +179,15 @@ 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
|
||||
});
|
||||
if (this.protyle.options.handleEmptyContent) {
|
||||
this.protyle.options.handleEmptyContent();
|
||||
} else {
|
||||
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);
|
||||
|
|
2
app/src/types/protyle.d.ts
vendored
2
app/src/types/protyle.d.ts
vendored
|
@ -483,6 +483,8 @@ interface IProtyleOptions {
|
|||
preventInsetEmptyBlock?: boolean
|
||||
}
|
||||
|
||||
handleEmptyContent?(): void
|
||||
|
||||
/** 编辑器异步渲染完成后的回调方法 */
|
||||
after?(protyle: import("../protyle").Protyle): void;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue