mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
d054f6ffec
commit
ea589fef7b
2 changed files with 22 additions and 2 deletions
|
|
@ -104,6 +104,10 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|||
console.error(`plugin ${plugin.name} onLayoutReady error:`, e);
|
||||
}
|
||||
|
||||
if (isWindow()) {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.topBarIcons.forEach(element => {
|
||||
if (isMobile()) {
|
||||
document.querySelector("#menuAbout").after(element);
|
||||
|
|
@ -112,6 +116,7 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|||
}
|
||||
});
|
||||
|
||||
/// if !MOBILE
|
||||
window.siyuan.config.uiLayout.left.data.forEach((dockItem: IDockTab[], index: number) => {
|
||||
updateDock(dockItem, index, plugin, "Left");
|
||||
});
|
||||
|
|
@ -152,5 +157,5 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|||
}], dock.config.position === "RightBottom" ? 1 : 0, dock.config.index);
|
||||
}
|
||||
});
|
||||
// 等待 tab 完成后再 init Tab model
|
||||
/// endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {Constants} from "../constants";
|
|||
import {webFrame} from "electron";
|
||||
import {globalShortcut} from "../boot/globalShortcut";
|
||||
import {fetchPost} from "../util/fetch";
|
||||
import {JSONToCenter, resizeTabs} from "../layout/util";
|
||||
import {getInstanceById, JSONToCenter, resizeTabs} from "../layout/util";
|
||||
import {initStatus} from "../layout/status";
|
||||
import {appearance} from "../config/appearance";
|
||||
import {initAssets, setInlineStyle} from "../util/assets";
|
||||
|
|
@ -10,6 +10,8 @@ import {renderSnippet} from "../config/util/snippets";
|
|||
import {getSearch} from "../util/functions";
|
||||
import {initWindow} from "../boot/onGetConfig";
|
||||
import {App} from "../index";
|
||||
import {afterLoadPlugin} from "../plugin/loader";
|
||||
import {Tab} from "../layout/Tab";
|
||||
|
||||
export const init = (app: App) => {
|
||||
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
|
||||
|
|
@ -21,6 +23,7 @@ export const init = (app: App) => {
|
|||
if (layout.layout) {
|
||||
JSONToCenter(app, layout.layout);
|
||||
window.siyuan.layout.centerLayout = window.siyuan.layout.layout;
|
||||
afterLayout(app);
|
||||
return;
|
||||
}
|
||||
const tabJSON = JSON.parse(getSearch("json"));
|
||||
|
|
@ -37,6 +40,7 @@ export const init = (app: App) => {
|
|||
}]
|
||||
});
|
||||
window.siyuan.layout.centerLayout = window.siyuan.layout.layout;
|
||||
afterLayout(app);
|
||||
});
|
||||
initStatus(true);
|
||||
initWindow(app);
|
||||
|
|
@ -52,3 +56,14 @@ export const init = (app: App) => {
|
|||
}, 200);
|
||||
});
|
||||
};
|
||||
|
||||
const afterLayout = (app:App) => {
|
||||
app.plugins.forEach(item => {
|
||||
afterLoadPlugin(item);
|
||||
});
|
||||
document.querySelectorAll('li[data-type="tab-header"][data-init-active="true"]').forEach((item: HTMLElement) => {
|
||||
item.removeAttribute("data-init-active");
|
||||
const tab = getInstanceById(item.getAttribute("data-id")) as Tab;
|
||||
tab.parent.switchTab(item, false, false);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue