Vanessa 2025-01-10 14:31:23 +08:00
parent 8cce186b47
commit 87c8db09a0
3 changed files with 38 additions and 35 deletions

View file

@ -81,14 +81,14 @@ export class Tree {
style = `padding-left: ${(item.depth - 1) * 20 + 24}px`;
}
} else {
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
style = `padding-left: ${(item.depth * 18) || 4}px;margin-right: 2px`;
}
const showArrow = hasChild || (item.type === "backlink" && !isMobile());
// data-id 需要添加 item.id否则大纲更新时 name 不一致导致 https://github.com/siyuan-note/siyuan/issues/11843
html += `<li class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
${item.id ? 'data-node-id="' + item.id + '"' : ""}
${item.box ? 'data-notebook-id="' + item.box + '"' : ""}
style="--file-toggle-width:${(item.depth - 1) * 18 + 38}px"
style="--file-toggle-width:${item.depth === 0 ? 22 : ((item.depth + 1) * 18)}px"
data-treetype="${item.type}"
data-type="${item.nodeType}"
data-subtype="${item.subType}"
@ -140,10 +140,10 @@ ${item.label ? "data-label='" + item.label + "'" : ""}>
style = `padding-left: ${(item.depth - 1) * 20 + 24}px`;
}
} else {
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
style = `padding-left: ${item.depth * 18 || 4}px;margin-right: 2px`;
}
html += `<li class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
style="--file-toggle-width:${(item.depth - 1) * 18 + 38}px"
style="--file-toggle-width:${item.depth === 0 ? 22 : ((item.depth + 1) * 18)}px"
data-node-id="${item.id}"
data-ref-text="${encodeURIComponent(item.refText)}"
data-def-id="${item.defID}"