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

Vanessa4df5be8f3f1d
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index 6b146a9414..1ca1f1a71c 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -280,7 +280,7 @@ export class Outline extends Model {
if (editItem.editor.protyle.block.rootID === this.blockId) {
let previousID;
let parentID;
- const undoPreviousID = item.previousElementSibling?.getAttribute("data-node-id");
+ const undoPreviousID = (item.previousElementSibling && item.previousElementSibling.tagName === "UL") ? item.previousElementSibling.previousElementSibling.getAttribute("data-node-id") : item.previousElementSibling?.getAttribute("data-node-id");
const undoParentID = item.parentElement.previousElementSibling?.getAttribute("data-node-id");
if (selectItem.classList.contains("dragover")) {
parentID = selectItem.getAttribute("data-node-id");
@@ -292,7 +292,11 @@ export class Outline extends Model {
}
} else if (selectItem.classList.contains("dragover__top")) {
parentID = selectItem.parentElement.previousElementSibling?.getAttribute("data-node-id");
- previousID = selectItem.previousElementSibling?.getAttribute("data-node-id");
+ if (selectItem.previousElementSibling && selectItem.previousElementSibling.tagName === "UL") {
+ previousID = selectItem.previousElementSibling.previousElementSibling.getAttribute("data-node-id");
+ } else {
+ previousID = selectItem.previousElementSibling?.getAttribute("data-node-id");
+ }
selectItem.before(item);
} else if (selectItem.classList.contains("dragover__bottom")) {
previousID = selectItem.getAttribute("data-node-id");