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/13225

Vanessa441b6f7f6542
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 948fa89b98..a4a7126907 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -1132,15 +1132,28 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
blockElement.setAttribute("updated", newUpdated);
}
} else {
- for (let i = 0; i < ids.length; i++) {
- if (ids[i]) {
- await fetchSyncPost("/api/filetree/doc2Heading", {
- srcID: ids[i],
- after: targetElement.classList.contains("dragover__bottom"),
- targetID: targetElement.getAttribute("data-node-id"),
- });
+ if (targetElement.classList.contains("dragover__bottom")) {
+ for (let i = ids.length - 1; i > -1; i--) {
+ if (ids[i]) {
+ await fetchSyncPost("/api/filetree/doc2Heading", {
+ srcID: ids[i],
+ after: true,
+ targetID: targetElement.getAttribute("data-node-id"),
+ });
+ }
+ }
+ } else {
+ for (let i = 0; i < ids.length; i++) {
+ if (ids[i]) {
+ await fetchSyncPost("/api/filetree/doc2Heading", {
+ srcID: ids[i],
+ after: false,
+ targetID: targetElement.getAttribute("data-node-id"),
+ });
+ }
}
}
+
fetchPost("/api/filetree/getDoc", {
id: protyle.block.id,
size: window.siyuan.config.editor.dynamicLoadBlocks,