Skip to content

Commit

Permalink
🎨 #13791
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 12, 2025
1 parent 87f3047 commit 4abc67c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/dialog/processSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ export const setDefRefCount = (data: {
"rootRefCount": number,
"rootID": string
refIDs: string[]
rootRefIDs: string[]
}) => {
getAllEditor().forEach(editor => {
if (data.rootID === data.blockID && editor.protyle.block.rootID === data.rootID) {
if (editor.protyle.block.rootID === data.rootID) {
if (!editor.protyle.title) {
return;
}
Expand All @@ -183,13 +184,16 @@ export const setDefRefCount = (data: {
countElement.remove();
} else {
countElement.textContent = data.rootRefCount.toString();
countElement.setAttribute("data-id", JSON.stringify(data.refIDs));
countElement.setAttribute("data-id", JSON.stringify(data.rootRefIDs));
}
} else if (data.rootRefCount > 0) {
attrElement.insertAdjacentHTML("beforeend", `<div class="protyle-attr--refcount popover__block" data-defids="[&quot;${data.blockID}&quot;]" data-id="${JSON.stringify(data.refIDs)}" style="">${data.rootRefCount}</div>`);
attrElement.insertAdjacentHTML("beforeend", `<div class="protyle-attr--refcount popover__block" data-defids="[&quot;${data.rootID}&quot;]" data-id="${JSON.stringify(data.rootRefIDs)}" style="">${data.rootRefCount}</div>`);
}
return;
}
if (data.rootID === data.blockID) {
return;
}
// 不能对比 rootId,否则嵌入块中的锚文本无法更新
editor.protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${data.blockID}"]`).forEach(item => {
// 不能直接查询,否则列表中会获取到第一个列表项的 attr https://github.com/siyuan-note/siyuan/issues/12738
Expand Down

0 comments on commit 4abc67c

Please sign in to comment.