mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
ff64e5fcef
commit
b6b0f0c7b4
3 changed files with 10 additions and 1 deletions
|
|
@ -75,6 +75,7 @@ export abstract class Constants {
|
|||
public static readonly TIMEOUT_SEARCH = 300;
|
||||
public static readonly TIMEOUT_INPUT = 256;
|
||||
public static readonly TIMEOUT_BLOCKLOAD = 300;
|
||||
public static readonly TIMEOUT_TRANSITION = 150;
|
||||
|
||||
// help path
|
||||
public static readonly HELP_PATH = {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ export class Tab {
|
|||
this.headElement = document.createElement("li");
|
||||
this.headElement.setAttribute("data-type", "tab-header");
|
||||
this.headElement.setAttribute("draggable", "true");
|
||||
this.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
|
||||
this.headElement.setAttribute("data-id", this.id);
|
||||
this.headElement.setAttribute("data-position", "center"); // showTooltip 位置标识
|
||||
this.headElement.classList.add("item", "item--focus");
|
||||
|
|
|
|||
|
|
@ -443,6 +443,10 @@ export class Wnd {
|
|||
this.headersElement.children[oldFocusIndex].after(tab.headElement);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
tab.headElement.removeAttribute("style")
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
|
||||
tab.headElement.querySelector(".item__close").addEventListener("click", (event) => {
|
||||
if (tab.headElement.classList.contains("item--pin")) {
|
||||
tab.unpin();
|
||||
|
|
@ -611,7 +615,10 @@ export class Wnd {
|
|||
this.switchTab(this.children[currentIndex].headElement, true);
|
||||
}
|
||||
}
|
||||
item.headElement.remove();
|
||||
item.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
|
||||
setTimeout(() => {
|
||||
item.headElement.remove();
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
}
|
||||
item.panelElement.remove();
|
||||
this.destroyModel(item.model);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue