mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 01:21:14 +08:00
This commit is contained in:
parent
82fe12d84b
commit
b166fd87cd
@ -83,15 +83,15 @@ export class Tree {
|
|||||||
} else {
|
} else {
|
||||||
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
|
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
|
||||||
}
|
}
|
||||||
|
const showArrow = hasChild || (item.type === "backlink" && !isMobile());
|
||||||
html += `<li class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
|
html += `<li class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
|
||||||
${(item.nodeType !== "NodeDocument" && item.type === "backlink") ? 'draggable="true" ' : ""}
|
|
||||||
${item.id ? 'data-node-id="' + item.id + '"' : ""}
|
${item.id ? 'data-node-id="' + item.id + '"' : ""}
|
||||||
${item.box ? 'data-notebook-id="' + item.box + '"' : ""}
|
${item.box ? 'data-notebook-id="' + item.box + '"' : ""}
|
||||||
data-treetype="${item.type}"
|
data-treetype="${item.type}"
|
||||||
data-type="${item.nodeType}"
|
data-type="${item.nodeType}"
|
||||||
data-subtype="${item.subType}"
|
data-subtype="${item.subType}"
|
||||||
${item.label ? "data-label='" + item.label + "'" : ""}>
|
${item.label ? "data-label='" + item.label + "'" : ""}>
|
||||||
<span style="${style}" class="b3-list-item__toggle${(item.type === "backlink" || hasChild) ? " b3-list-item__toggle--hl" : ""}${hasChild || item.type === "backlink" ? "" : " fn__hidden"}">
|
<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="${encodeURIComponent(item.name + item.depth)}" class="b3-list-item__arrow${hasChild ? " b3-list-item__arrow--open" : ""}"><use xlink:href="#iconRight"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
${iconHTML}
|
${iconHTML}
|
||||||
@ -140,14 +140,13 @@ ${item.label ? "data-label='" + item.label + "'" : ""}>
|
|||||||
} else {
|
} else {
|
||||||
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
|
style = `padding-left: ${(item.depth - 1) * 18 + 22}px;margin-right: 2px`;
|
||||||
}
|
}
|
||||||
html += `<li ${type === "backlink" ? 'draggable="true"' : ""}
|
html += `<li class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
|
||||||
class="b3-list-item${isMobile() ? "" : " b3-list-item--hide-action"}"
|
|
||||||
data-node-id="${item.id}"
|
data-node-id="${item.id}"
|
||||||
data-ref-text="${encodeURIComponent(item.refText)}"
|
data-ref-text="${encodeURIComponent(item.refText)}"
|
||||||
data-def-id="${item.defID}"
|
data-def-id="${item.defID}"
|
||||||
data-type="${item.type}"
|
data-type="${item.type}"
|
||||||
data-subtype="${item.subType}"
|
data-subtype="${item.subType}"
|
||||||
data-treetype="${type}"
|
data-treetype="${type}"
|
||||||
data-def-path="${item.defPath}">
|
data-def-path="${item.defPath}">
|
||||||
<span style="${style}" class="b3-list-item__toggle${item.children ? " b3-list-item__toggle--hl" : ""}${item.children ? "" : " fn__hidden"}">
|
<span style="${style}" class="b3-list-item__toggle${item.children ? " b3-list-item__toggle--hl" : ""}${item.children ? "" : " fn__hidden"}">
|
||||||
<svg data-id="${item.id}" class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
|
<svg data-id="${item.id}" class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
|
||||||
|
Loading…
Reference in New Issue
Block a user