mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
e99c37a0e1
commit
904b9faf8c
2 changed files with 8 additions and 4 deletions
|
|
@ -84,6 +84,7 @@ export class Tree {
|
|||
style = `padding-left: ${(item.depth - 1) * 18 + 22}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 + '"' : ""}
|
||||
|
|
@ -93,7 +94,7 @@ data-type="${item.nodeType}"
|
|||
data-subtype="${item.subType}"
|
||||
${item.label ? "data-label='" + item.label + "'" : ""}>
|
||||
<span style="${style}" class="b3-list-item__toggle${showArrow ? " b3-list-item__toggle--hl" : ""}${showArrow ? "" : " fn__hidden"}">
|
||||
<svg data-id="${encodeURIComponent(item.name + item.depth)}" class="b3-list-item__arrow${hasChild ? " b3-list-item__arrow--open" : ""}"><use xlink:href="#iconRight"></use></svg>
|
||||
<svg data-id="${item.id || encodeURIComponent(item.name + item.depth)}" class="b3-list-item__arrow${hasChild ? " b3-list-item__arrow--open" : ""}"><use xlink:href="#iconRight"></use></svg>
|
||||
</span>
|
||||
${iconHTML}
|
||||
<span class="b3-list-item__text ariaLabel" data-position="parentE"${titleTip}>${item.name}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue