Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/13864

Vanessa3185c8ff6f48
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 06e84c863e..56008fb575 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -485,6 +485,7 @@ export class Files extends Model {
});
/// #endif
});
+ let dragoverLiObj: { element: HTMLElement, rect: DOMRect };
this.element.addEventListener("dragover", (event: DragEvent & { target: HTMLElement }) => {
if (window.siyuan.config.readonly || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) {
return;
@@ -497,6 +498,12 @@ export class Files extends Model {
event.preventDefault();
return;
}
+ if (!dragoverLiObj || dragoverLiObj.element !== liElement) {
+ dragoverLiObj = {
+ element: liElement,
+ rect: liElement.getBoundingClientRect()
+ };
+ }
this.element.querySelectorAll(".dragover, .dragover__bottom, .dragover__top").forEach((item: HTMLElement) => {
item.classList.remove("dragover", "dragover__bottom", "dragover__top");
});
@@ -538,7 +545,7 @@ export class Files extends Model {
(!sourceOnlyRoot && targetType !== "navigation-root" &&
(notebookSort === "6" || (window.siyuan.config.fileTree.sort === 6 && notebookSort === "15")))
) {
- const nodeRect = liElement.getBoundingClientRect();
+ const nodeRect = dragoverLiObj.rect;
const dragHeight = nodeRect.height * .2;
if (targetType === "navigation-root" && sourceOnlyRoot) {
if (event.clientY > nodeRect.top + nodeRect.height / 2) {