Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/7302

Vanessa401f3d1ac698
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index f3b3c64807..934b676cc9 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -15,7 +15,7 @@ import {newNotebook} from "../../util/mount";
import {confirmDialog} from "../../dialog/confirmDialog";
import {updateHotkeyTip} from "../../protyle/util/compatibility";
import {openFileById} from "../../editor/util";
-import {hasClosestByTag, hasTopClosestByTag} from "../../protyle/util/hasClosest";
+import {hasClosestByAttribute, hasClosestByTag, hasTopClosestByTag} from "../../protyle/util/hasClosest";
import {isTouchDevice} from "../../util/functions";
export class Files extends Model {
@@ -372,7 +372,14 @@ export class Files extends Model {
event.preventDefault();
return;
}
- if (window.siyuan.config.fileTree.sort === 6 &&
+ const notebookElement = hasClosestByAttribute(liElement, "data-sortmode", null);
+ if (!notebookElement) {
+ return;
+ }
+ const notebookSort = notebookElement.getAttribute("data-sortmode");
+ if ((
+ notebookSort === "6" || (window.siyuan.config.fileTree.sort === 6 && notebookSort === "15")
+ ) &&
// 防止文档拖拽到笔记本外
!(!sourceOnlyRoot && targetType === "navigation-root")) {
const nodeRect = liElement.getBoundingClientRect();
@@ -462,7 +469,10 @@ export class Files extends Model {
toPath,
});
}
- if ((newElement.classList.contains("dragover__bottom") || newElement.classList.contains("dragover__top")) && window.siyuan.config.fileTree.sort === 6) {
+ const ulSort = newUlElement.getAttribute("data-sortmode");
+ if ((newElement.classList.contains("dragover__bottom") || newElement.classList.contains("dragover__top")) &&
+ (ulSort === "6" || (window.siyuan.config.fileTree.sort === 6 && ulSort === "15"))
+ ) {
if (selectRootElements.length > 0 && newElement.getAttribute("data-path") === "/") {
if (newElement.classList.contains("dragover__top")) {
selectRootElements.forEach(item => {