mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
df3ee3f24e
commit
67b81bfaad
15 changed files with 117 additions and 6 deletions
|
|
@ -145,7 +145,7 @@ export const resetLayout = () => {
|
|||
});
|
||||
};
|
||||
|
||||
export const exportLayout = (reload: boolean, cb?: () => void) => {
|
||||
export const exportLayout = (reload: boolean, cb?: () => void, onlyData = false) => {
|
||||
const useElement = document.querySelector("#barDock use");
|
||||
if (!useElement) {
|
||||
return;
|
||||
|
|
@ -158,7 +158,10 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
|
|||
right: dockToJSON(window.siyuan.layout.rightDock),
|
||||
};
|
||||
layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);
|
||||
fetchPost("/api/system/setUILayout", {layout: layoutJSON, exit: typeof cb !== "undefined"}, () => {
|
||||
if (onlyData) {
|
||||
return layoutJSON;
|
||||
}
|
||||
fetchPost("/api/system/setUILayout", {layout: layoutJSON}, () => {
|
||||
if (reload) {
|
||||
window.location.reload();
|
||||
} else if (cb) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue