mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
088afbc2ea
commit
7735a018f3
1 changed files with 32 additions and 0 deletions
|
|
@ -1720,6 +1720,22 @@ export class Gutter {
|
||||||
itemElement.remove();
|
itemElement.remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
if (protyle.wysiwyg.element.childElementCount === 0) {
|
||||||
|
const newID = Lute.NewNodeID();
|
||||||
|
const emptyElement = genEmptyElement(false, false, newID);
|
||||||
|
protyle.wysiwyg.element.insertAdjacentElement("afterbegin", emptyElement);
|
||||||
|
response.data.doOperations.push({
|
||||||
|
action: "insert",
|
||||||
|
data: emptyElement.outerHTML,
|
||||||
|
id: newID,
|
||||||
|
parentID: protyle.block.parentID
|
||||||
|
});
|
||||||
|
response.data.undoOperations.push({
|
||||||
|
action: "delete",
|
||||||
|
id: newID,
|
||||||
|
});
|
||||||
|
focusBlock(emptyElement);
|
||||||
|
}
|
||||||
transaction(protyle, response.data.doOperations, response.data.undoOperations);
|
transaction(protyle, response.data.doOperations, response.data.undoOperations);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -1738,6 +1754,22 @@ export class Gutter {
|
||||||
itemElement.remove();
|
itemElement.remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
if (protyle.wysiwyg.element.childElementCount === 0) {
|
||||||
|
const newID = Lute.NewNodeID();
|
||||||
|
const emptyElement = genEmptyElement(false, false, newID);
|
||||||
|
protyle.wysiwyg.element.insertAdjacentElement("afterbegin", emptyElement);
|
||||||
|
response.data.doOperations.push({
|
||||||
|
action: "insert",
|
||||||
|
data: emptyElement.outerHTML,
|
||||||
|
id: newID,
|
||||||
|
parentID: protyle.block.parentID
|
||||||
|
});
|
||||||
|
response.data.undoOperations.push({
|
||||||
|
action: "delete",
|
||||||
|
id: newID,
|
||||||
|
});
|
||||||
|
focusBlock(emptyElement);
|
||||||
|
}
|
||||||
transaction(protyle, response.data.doOperations, response.data.undoOperations);
|
transaction(protyle, response.data.doOperations, response.data.undoOperations);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue