mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
e533b24f3d
commit
62d66c8638
1 changed files with 8 additions and 5 deletions
|
|
@ -22,6 +22,7 @@ import {Search} from "../search";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {openFileById, updatePanelByEditor} from "../editor/util";
|
import {openFileById, updatePanelByEditor} from "../editor/util";
|
||||||
import {scrollCenter} from "../util/highlightById";
|
import {scrollCenter} from "../util/highlightById";
|
||||||
|
import {getAllModels} from "./getAll";
|
||||||
|
|
||||||
export class Wnd {
|
export class Wnd {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
@ -433,11 +434,6 @@ export class Wnd {
|
||||||
this.children.find((item, index) => {
|
this.children.find((item, index) => {
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
if (this.children.length === 1) {
|
if (this.children.length === 1) {
|
||||||
if (this.children[0].model && this.children[0].model instanceof Editor) {
|
|
||||||
// 关闭窗口中的最后一个 tab
|
|
||||||
setPanelFocus(this.headersElement.parentElement);
|
|
||||||
updatePanelByEditor();
|
|
||||||
}
|
|
||||||
this.destroyModel(this.children[0].model);
|
this.destroyModel(this.children[0].model);
|
||||||
this.children = [];
|
this.children = [];
|
||||||
if (["top", "bottom", "left", "right"].includes(this.parent.type)) {
|
if (["top", "bottom", "left", "right"].includes(this.parent.type)) {
|
||||||
|
|
@ -445,6 +441,13 @@ export class Wnd {
|
||||||
} else {
|
} else {
|
||||||
this.remove();
|
this.remove();
|
||||||
}
|
}
|
||||||
|
getAllModels().editor.forEach(item => {
|
||||||
|
if (!item.element.classList.contains("fn__none")) {
|
||||||
|
setPanelFocus(item.parent.parent.headersElement.parentElement);
|
||||||
|
updatePanelByEditor(item.editor.protyle, true, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.headElement) {
|
if (item.headElement) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue