mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
badfd65f2a
commit
848723c484
1 changed files with 4 additions and 30 deletions
|
|
@ -13,7 +13,7 @@ import {Bookmark} from "./dock/Bookmark";
|
||||||
import {updateHotkeyTip} from "../protyle/util/compatibility";
|
import {updateHotkeyTip} from "../protyle/util/compatibility";
|
||||||
import {Backlinks} from "./dock/Backlinks";
|
import {Backlinks} from "./dock/Backlinks";
|
||||||
import {Tag} from "./dock/Tag";
|
import {Tag} from "./dock/Tag";
|
||||||
import {getAllModels} from "./getAll";
|
import {getAllModels, getAllTabs} from "./getAll";
|
||||||
import {Asset} from "../asset";
|
import {Asset} from "../asset";
|
||||||
import {Search} from "../search";
|
import {Search} from "../search";
|
||||||
import {Dock} from "./dock";
|
import {Dock} from "./dock";
|
||||||
|
|
@ -267,37 +267,11 @@ const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model) => {
|
||||||
export const JSONToLayout = (isStart: boolean) => {
|
export const JSONToLayout = (isStart: boolean) => {
|
||||||
JSONToCenter(window.siyuan.config.uiLayout.layout);
|
JSONToCenter(window.siyuan.config.uiLayout.layout);
|
||||||
JSONToDock(window.siyuan.config.uiLayout);
|
JSONToDock(window.siyuan.config.uiLayout);
|
||||||
const allModels = getAllModels();
|
|
||||||
// 启动时不打开页签,需要移除没有钉住的页签
|
// 启动时不打开页签,需要移除没有钉住的页签
|
||||||
if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) {
|
if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) {
|
||||||
allModels.editor.forEach(item => {
|
getAllTabs().forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.headElement && !item.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.removeTab(item.id);
|
||||||
}
|
|
||||||
});
|
|
||||||
allModels.outline.forEach(item => {
|
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
allModels.search.forEach(item => {
|
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
allModels.asset.forEach(item => {
|
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
allModels.graph.forEach(item => {
|
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
allModels.backlinks.forEach(item => {
|
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue