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

View file

@ -314,36 +314,6 @@ html {
opacity: .38;
}
.dragover:not([data-type="navigation-root"]):not([data-subtype="h1"])::after {
width: calc(100% - var(--file-toggle-width));
left: var(--file-toggle-width);
}
.dragover__top,
.dragover__bottom {
box-shadow: none !important;
}
.dragover__top::after,
.dragover__bottom::after {
content: "";
position: absolute;
height: 4px;
width: calc(100% - var(--file-toggle-width));
left: var(--file-toggle-width);
background-color: var(--b3-theme-primary-lighter);
z-index: 1;
pointer-events: none;
}
.dragover__top::after {
top: -3px;
}
.dragover__bottom::after {
bottom: -2px;
}
&__close {
min-height: auto;
transition: var(--b3-transition);
@ -354,6 +324,39 @@ html {
overflow: hidden;
transition: var(--b3-transition);
}
&.sy__outline,
&.sy__file {
.dragover::after {
width: calc(100% - var(--file-toggle-width));
left: var(--file-toggle-width);
}
.dragover__top,
.dragover__bottom {
box-shadow: none !important;
}
.dragover__top::after,
.dragover__bottom::after {
content: "";
position: absolute;
height: 4px;
width: calc(100% - var(--file-toggle-width));
left: var(--file-toggle-width);
background-color: var(--b3-theme-primary-lighter);
z-index: 1;
pointer-events: none;
}
.dragover__top::after {
top: -3px;
}
.dragover__bottom::after {
bottom: -2px;
}
}
}
.counter {

View file

@ -760,7 +760,7 @@ export class Files extends Model {
} else {
return `<ul class="b3-list b3-list--background" data-url="${item.id}" data-sort="${item.sort}" data-sortmode="${item.sortMode}">
<li class="b3-list-item b3-list-item--hide-action" ${window.siyuan.config.fileTree.sort === 6 ? 'draggable="true"' : ""}
style="--file-toggle-width:18px"
style="--file-toggle-width:22px"
data-type="navigation-root" data-path="/">
<span class="b3-list-item__toggle b3-list-item__toggle--hl">
<svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>

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}"