mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
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();
|
window.siyuan.menus.menu.remove();
|
||||||
break;
|
break;
|
||||||
} else if (type === "focus") {
|
} else if (type === "focus") {
|
||||||
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
|
let element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") as HTMLElement;
|
||||||
document.querySelector("ul.layout-tab-bar > .item--focus");
|
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) {
|
if (element) {
|
||||||
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
|
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
|
||||||
if (tab && tab.model instanceof Editor) {
|
if (tab && tab.model instanceof Editor) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue