mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
9966bd7980
commit
c510b30ecc
1 changed files with 8 additions and 8 deletions
|
|
@ -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 }) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue