mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 15:11:10 +08:00
🎨 https://github.com/siyuan-note/siyuan/issues/5066 onLayoutReady
This commit is contained in:
parent
fb6b4e48ca
commit
b898f7b4c7
@ -449,16 +449,20 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
|
|||||||
}
|
}
|
||||||
const idZoomIn = getIdZoomInByPath();
|
const idZoomIn = getIdZoomInByPath();
|
||||||
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
// 启动时 layout 中有该文档,该文档还原会在此之后,因此需有延迟
|
// 启动时 layout 中有该文档,该文档还原会在此之后,因此需有延迟
|
||||||
if (idZoomIn.id) {
|
if (idZoomIn.id) {
|
||||||
setTimeout(() => {
|
|
||||||
openFileById({
|
openFileById({
|
||||||
id: idZoomIn.id,
|
id: idZoomIn.id,
|
||||||
action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||||
zoomIn: idZoomIn.isZoomIn
|
zoomIn: idZoomIn.isZoomIn
|
||||||
});
|
});
|
||||||
}, Constants.TIMEOUT_LOAD);
|
|
||||||
}
|
}
|
||||||
|
app.plugins.forEach(item => {
|
||||||
|
item.onLayoutReady();
|
||||||
|
})
|
||||||
|
}, Constants.TIMEOUT_LOAD);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any, dropEditScroll = false) => {
|
export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any, dropEditScroll = false) => {
|
||||||
|
@ -47,6 +47,10 @@ export class Plugin {
|
|||||||
// 禁用/卸载
|
// 禁用/卸载
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public onLayoutReady() {
|
||||||
|
// 布局加载完成
|
||||||
|
}
|
||||||
|
|
||||||
public addTopBar(options: {
|
public addTopBar(options: {
|
||||||
icon: string,
|
icon: string,
|
||||||
title: string,
|
title: string,
|
||||||
|
Loading…
Reference in New Issue
Block a user