This commit is contained in:
Vanessa 2023-02-22 10:18:18 +08:00
parent 98350e7768
commit 71e01a1fb5

View File

@ -784,7 +784,19 @@ export class Wnd {
return true;
}
});
oldWnd.switchTab(oldWnd.children[oldWnd.children.length - 1].headElement);
if (!oldWnd.headersElement.querySelector(".item--focus")) {
let latestHeadElement: HTMLElement;
Array.from(oldWnd.headersElement.children).forEach((headItem: HTMLElement) => {
if (!latestHeadElement) {
latestHeadElement = headItem;
} else if (headItem.getAttribute("data-activetime") > latestHeadElement.getAttribute("data-activetime")) {
latestHeadElement = headItem;
}
});
if (latestHeadElement) {
oldWnd.switchTab(latestHeadElement, true);
}
}
}
tab.parent = this;
resizeTabs();