Vanessa 2022-10-14 11:12:35 +08:00
parent ff64e5fcef
commit b6b0f0c7b4
3 changed files with 10 additions and 1 deletions

View file

@ -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 = {

View file

@ -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");

View file

@ -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.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
setTimeout(() => {
item.headElement.remove();
}, Constants.TIMEOUT_TRANSITION);
}
item.panelElement.remove();
this.destroyModel(item.model);