This commit is contained in:
parent
d9a4e43979
commit
74db798a04
1 changed files with 11 additions and 2 deletions
|
@ -212,8 +212,17 @@ export class Files extends Model {
|
|||
window.siyuan.menus.menu.remove();
|
||||
break;
|
||||
} else if (type === "focus") {
|
||||
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
|
||||
document.querySelector("ul.layout-tab-bar > .item--focus");
|
||||
let element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") as HTMLElement;
|
||||
if (!element) {
|
||||
document.querySelectorAll("ul.layout-tab-bar > .item--focus").forEach((item: HTMLElement, index) => {
|
||||
if (index === 0) {
|
||||
element = item
|
||||
} else if (item.dataset.activetime > element.dataset.activetime) {
|
||||
element = item;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (element) {
|
||||
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
|
||||
if (tab && tab.model instanceof Editor) {
|
||||
|
|
Loading…
Add table
Reference in a new issue