mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
f7549b978e
commit
a1fa1d16bb
3 changed files with 16 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue