This commit is contained in:
Vanessa 2022-09-08 22:04:57 +08:00
parent 59ff5bd547
commit 056c136bc1
5 changed files with 9 additions and 5 deletions

View file

@ -349,7 +349,7 @@ export const updatePanelByEditor = (protyle?: IProtyle, focus = true, pushBackSt
};
export const isCurrentEditor = (blockId: string) => {
const activeElement = document.querySelector(".layout__wnd--active > .layout-tab-bar > .item--focus");
const activeElement = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus");
if (activeElement) {
const tab = getInstanceById(activeElement.getAttribute("data-id"));
if (tab instanceof Tab && tab.model instanceof Editor) {

View file

@ -742,6 +742,10 @@ export class Wnd {
previous.element.style.height = (previous.element.clientHeight + element.clientHeight) + "px";
}
}
// https://github.com/siyuan-note/siyuan/issues/5844
if (layout.children.length > 2 && index === 0) {
layout.children[1].resize = undefined;
}
}
layout.children.splice(index, 1);
return true;

View file

@ -162,7 +162,7 @@ export class Files extends Model {
window.siyuan.menus.menu.remove();
break;
} else if (type === "focus") {
const element = document.querySelector(".layout__wnd--active > .layout-tab-bar > .item--focus") ||
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
document.querySelector(".layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;

View file

@ -809,7 +809,7 @@ const fileTreeKeydown = (event: KeyboardEvent) => {
if (matchHotKey(window.siyuan.config.keymap.general.selectOpen1.custom, event)) {
event.preventDefault();
event.stopPropagation();
const element = document.querySelector(".layout__wnd--active > .layout-tab-bar > .item--focus") ||
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
document.querySelector(".layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;