Vanessa 2024-01-24 13:13:32 +08:00
parent bb49855133
commit 6930d48446
4 changed files with 9 additions and 2 deletions

View file

@ -3,7 +3,7 @@ import {showMessage} from "../dialog/message";
import {fetchPost} from "../util/fetch"; import {fetchPost} from "../util/fetch";
import {confirmDialog} from "../dialog/confirmDialog"; import {confirmDialog} from "../dialog/confirmDialog";
import {highlightRender} from "../protyle/render/highlightRender"; import {highlightRender} from "../protyle/render/highlightRender";
import {exportLayout} from "../layout/util"; import {exportLayout, saveLayout} from "../layout/util";
import {Constants} from "../constants"; import {Constants} from "../constants";
/// #if !BROWSER /// #if !BROWSER
import {shell} from "electron"; import {shell} from "electron";
@ -813,6 +813,7 @@ export const bazaar = {
afterLoadPlugin(item); afterLoadPlugin(item);
}); });
}); });
saveLayout();
} }
}); });
} }

View file

@ -485,6 +485,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
app.plugins.forEach(item => { app.plugins.forEach(item => {
afterLoadPlugin(item); afterLoadPlugin(item);
}); });
saveLayout();
resizeTopBar(); resizeTopBar();
}; };

View file

@ -1,4 +1,5 @@
import {MenuItem} from "./Menu"; import {MenuItem} from "./Menu";
import {saveLayout} from "../layout/util";
const moveMenuItem = (label: string, target: Element) => { const moveMenuItem = (label: string, target: Element) => {
return new MenuItem({ return new MenuItem({
@ -12,6 +13,7 @@ const moveMenuItem = (label: string, target: Element) => {
} else if (label.indexOf("moveToBottom") > -1) { } else if (label.indexOf("moveToBottom") > -1) {
window.siyuan.layout.bottomDock.add(label.endsWith("Left") ? 0 : 1, target); window.siyuan.layout.bottomDock.add(label.endsWith("Left") ? 0 : 1, target);
} }
saveLayout();
} }
}); });
}; };

View file

@ -81,6 +81,7 @@ export const loadPlugin = async (app: App, item: IPluginData) => {
styleElement.textContent = item.css; styleElement.textContent = item.css;
document.head.append(styleElement); document.head.append(styleElement);
afterLoadPlugin(plugin); afterLoadPlugin(plugin);
saveLayout();
return plugin; return plugin;
}; };
@ -229,7 +230,6 @@ export const afterLoadPlugin = (plugin: Plugin) => {
}], dock.config.position === "RightBottom" ? 1 : 0, dock.config.index); }], dock.config.position === "RightBottom" ? 1 : 0, dock.config.index);
} }
}); });
saveLayout();
/// #endif /// #endif
}; };
@ -242,4 +242,7 @@ export const reloadPlugin = (app: App) => {
afterLoadPlugin(item); afterLoadPlugin(item);
}); });
}); });
/// #if !MOBILE
saveLayout();
/// #endif
}; };