mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
ac6b1d6689
commit
65b52a2bc6
1 changed files with 8 additions and 1 deletions
|
@ -236,7 +236,14 @@ const getActiveEditor = (wndActive = true) => {
|
|||
if (!editor && !wndActive) {
|
||||
let activeTime = 0;
|
||||
allEditor.forEach(item => {
|
||||
const headerElement = item.protyle.model?.parent.headElement;
|
||||
let headerElement = item.protyle.model?.parent.headElement;
|
||||
if (!headerElement && item.protyle.element.getBoundingClientRect().height > 0) {
|
||||
const tabBodyElement = item.protyle.element.parentElement.parentElement.parentElement;
|
||||
const tabId = tabBodyElement.getAttribute("data-id");
|
||||
if (tabBodyElement.classList.contains("fn__flex-1") && tabId) {
|
||||
headerElement = document.querySelector(`.layout-tab-bar .item[data-id="${tabId}"]`);
|
||||
}
|
||||
}
|
||||
if (headerElement) {
|
||||
if (headerElement.classList.contains("item--focus") && parseInt(headerElement.dataset.activetime) > activeTime) {
|
||||
activeTime = parseInt(headerElement.dataset.activetime);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue