mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
🎨 Backlink count at the doc block title including sub-blocks https://github.com/siyuan-note/siyuan/issues/13791
This commit is contained in:
parent
91ee1ccf0b
commit
3ebcf5fcb9
1 changed files with 1 additions and 5 deletions
|
|
@ -173,10 +173,7 @@ export const setDefRefCount = (data: {
|
||||||
rootRefIDs: string[]
|
rootRefIDs: string[]
|
||||||
}) => {
|
}) => {
|
||||||
getAllEditor().forEach(editor => {
|
getAllEditor().forEach(editor => {
|
||||||
if (editor.protyle.block.rootID === data.rootID) {
|
if (editor.protyle.block.rootID === data.rootID && editor.protyle.title) {
|
||||||
if (!editor.protyle.title) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const attrElement = editor.protyle.title.element.querySelector(".protyle-attr");
|
const attrElement = editor.protyle.title.element.querySelector(".protyle-attr");
|
||||||
const countElement = attrElement.querySelector(".protyle-attr--refcount");
|
const countElement = attrElement.querySelector(".protyle-attr--refcount");
|
||||||
if (countElement) {
|
if (countElement) {
|
||||||
|
|
@ -189,7 +186,6 @@ export const setDefRefCount = (data: {
|
||||||
} else if (data.rootRefCount > 0) {
|
} else if (data.rootRefCount > 0) {
|
||||||
attrElement.insertAdjacentHTML("beforeend", `<div class="protyle-attr--refcount popover__block" data-defids="["${data.rootID}"]" data-id="${JSON.stringify(data.rootRefIDs)}" style="">${data.rootRefCount}</div>`);
|
attrElement.insertAdjacentHTML("beforeend", `<div class="protyle-attr--refcount popover__block" data-defids="["${data.rootID}"]" data-id="${JSON.stringify(data.rootRefIDs)}" style="">${data.rootRefCount}</div>`);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (data.rootID === data.blockID) {
|
if (data.rootID === data.blockID) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue