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

Vanessa655d7cd41b0d
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index 771b5d092a..05a330d749 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -233,15 +233,8 @@ export class Outline extends Model {
return;
}
const documentSelf = document;
- item.style.opacity = "0.38";
- const ghostElement = item.cloneNode(true) as HTMLElement;
- this.element.append(ghostElement);
- ghostElement.setAttribute("id", "dragGhost");
- ghostElement.firstElementChild.setAttribute("style", "padding-left:4px");
- ghostElement.setAttribute("style", `border-radius: var(--b3-border-radius);background-color: var(--b3-list-hover);position: fixed; top: ${event.clientY}px; left: ${event.clientX}px; z-index:999997;`);
-
documentSelf.ondragstart = () => false;
-
+ let ghostElement: HTMLElement
let selectItem: HTMLElement;
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
if (moveEvent.clientY === event.clientY && moveEvent.clientX === event.clientX) {
@@ -249,6 +242,14 @@ export class Outline extends Model {
}
moveEvent.preventDefault();
moveEvent.stopPropagation();
+ if (!ghostElement) {
+ item.style.opacity = "0.38";
+ ghostElement = item.cloneNode(true) as HTMLElement;
+ this.element.append(ghostElement);
+ ghostElement.setAttribute("id", "dragGhost");
+ ghostElement.firstElementChild.setAttribute("style", "padding-left:4px");
+ ghostElement.setAttribute("style", `border-radius: var(--b3-border-radius);background-color: var(--b3-list-hover);position: fixed; top: ${event.clientY}px; left: ${event.clientX}px; z-index:999997;`);
+ }
ghostElement.style.top = moveEvent.clientY + "px";
ghostElement.style.left = moveEvent.clientX + "px";
selectItem = hasClosestByClassName(moveEvent.target as HTMLElement, "b3-list-item") as HTMLElement;