mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
5c7f3ab0bd
commit
3741775dca
1 changed files with 5 additions and 4 deletions
|
|
@ -32,10 +32,11 @@ const setBacklinkFold = (html: string, expand: boolean) => {
|
||||||
tempDom.innerHTML = html;
|
tempDom.innerHTML = html;
|
||||||
if (tempDom.content.firstElementChild.classList.contains("li")) {
|
if (tempDom.content.firstElementChild.classList.contains("li")) {
|
||||||
if (expand) {
|
if (expand) {
|
||||||
const thirdLiElement = tempDom.content.querySelector(".li .li .li");
|
tempDom.content.querySelectorAll(".li .li .li").forEach(item => {
|
||||||
if (thirdLiElement) {
|
if (item.childElementCount > 3) {
|
||||||
thirdLiElement.setAttribute("fold", "1");
|
item.setAttribute("fold", "1");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
tempDom.content.firstElementChild.setAttribute("fold", "1");
|
tempDom.content.firstElementChild.setAttribute("fold", "1");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue