Skip to content

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

:sparkles: https://github.com/siyuan-note/siyuan/issues/2955

Vanessac510b30ecceb
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 52388056da..1a061cd40f 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -193,17 +193,17 @@ export class Wnd {
}
}
});
+ let dragleaveTimeout: number
this.headersElement.addEventListener("dragleave", function () {
+ clearTimeout(dragleaveTimeout)
+ // 窗口拖拽到新窗口时,不 drop 无法移除 clone 的元素
+ dragleaveTimeout = window.setTimeout(() => {
+ document.querySelectorAll(".layout-tab-bar li[data-clone='true']").forEach(item => {
+ item.remove();
+ });
+ }, 1000);
const it = this as HTMLElement;
it.classList.remove("layout-tab-bar--drag");
- document.querySelectorAll(".layout-tab-bar").forEach(item => {
- if (item !== it) {
- const cloneElement = item.querySelector("li[data-clone='true']");
- if (cloneElement) {
- cloneElement.remove();
- }
- }
- });
it.style.opacity = "";
});
this.headersElement.addEventListener("drop", function (event: DragEvent & { target: HTMLElement }) {