mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
aa5f5ddc5f
commit
35853cfedb
5 changed files with 36 additions and 20 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue