Vanessa 2024-06-29 11:06:38 +08:00
parent f7549b978e
commit a1fa1d16bb
3 changed files with 16 additions and 6 deletions

View file

@ -707,7 +707,7 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
if (inlineTypes.includes("code") || inlineTypes.includes("kbd")) {
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.copy,
icon:"iconCopy",
icon: "iconCopy",
click() {
writeText(protyle.lute.BlockDOM2StdMd(inlineElement.outerHTML));
}
@ -2078,7 +2078,7 @@ export const tableMenu = (protyle: IProtyle, nodeElement: Element, cellElement:
return {menus, removeMenus, insertMenus, otherMenus, other2Menus};
};
export const setFold = (protyle: IProtyle, nodeElement: Element, isOpen?: boolean, isRemove?: boolean) => {
export const setFold = (protyle: IProtyle, nodeElement: Element, isOpen?: boolean, isRemove?: boolean, addLoading = true) => {
if (nodeElement.getAttribute("data-type") === "NodeListItem" && nodeElement.childElementCount < 4) {
// 没有子列表或多个块的列表项不进行折叠
return -1;
@ -2124,7 +2124,9 @@ export const setFold = (protyle: IProtyle, nodeElement: Element, isOpen?: boolea
const id = nodeElement.getAttribute("data-node-id");
if (nodeElement.getAttribute("data-type") === "NodeHeading") {
if (hasFold) {
nodeElement.insertAdjacentHTML("beforeend", '<div spin="1" style="text-align: center"><img width="24px" height="24px" src="/stage/loading-pure.svg"></div>');
if (addLoading) {
nodeElement.insertAdjacentHTML("beforeend", '<div spin="1" style="text-align: center"><img width="24px" height="24px" src="/stage/loading-pure.svg"></div>');
}
transaction(protyle, [{
action: "unfoldHeading",
id,