This commit is contained in:
Vanessa 2023-04-09 17:29:19 +08:00
parent aa5f5ddc5f
commit 35853cfedb
5 changed files with 36 additions and 20 deletions

View file

@ -146,6 +146,22 @@ export const resetLayout = () => {
};
export const exportLayout = (reload: boolean, cb?: () => void, onlyData = false, errorExit = false) => {
if (isWindow()) {
const layoutJSON: any = {
layout: {},
};
layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);
if (onlyData) {
return layoutJSON;
}
sessionStorage.setItem("layout", JSON.stringify(layoutJSON));
if (reload) {
window.location.reload();
} else if (cb) {
cb();
}
return ;
}
const useElement = document.querySelector("#barDock use");
if (!useElement) {
return;