mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
95bb18afe1
commit
00eaf9b4b4
21 changed files with 123 additions and 111 deletions
|
|
@ -10,7 +10,7 @@ import {setPadding} from "../protyle/ui/initUI";
|
|||
import {newFile} from "../util/newFile";
|
||||
import {Outline} from "./dock/Outline";
|
||||
import {Bookmark} from "./dock/Bookmark";
|
||||
import {exportLocalStorage, updateHotkeyTip} from "../protyle/util/compatibility";
|
||||
import {updateHotkeyTip} from "../protyle/util/compatibility";
|
||||
import {Tag} from "./dock/Tag";
|
||||
import {getAllModels, getAllTabs} from "./getAll";
|
||||
import {Asset} from "../asset";
|
||||
|
|
@ -138,9 +138,7 @@ const dockToJSON = (dock: Dock) => {
|
|||
|
||||
export const resetLayout = () => {
|
||||
fetchPost("/api/system/setUILayout", {layout: {}}, () => {
|
||||
exportLocalStorage(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
window.location.reload();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -159,13 +157,11 @@ export const exportLayout = (reload: boolean, cb?: () => void) => {
|
|||
};
|
||||
layoutToJSON(window.siyuan.layout.layout, layoutJSON.layout);
|
||||
fetchPost("/api/system/setUILayout", {layout: layoutJSON, exit: typeof cb !== "undefined"}, () => {
|
||||
exportLocalStorage(() => {
|
||||
if (reload) {
|
||||
window.location.reload();
|
||||
} else if (cb) {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -541,7 +537,7 @@ export const copyTab = (tab: Tab) => {
|
|||
});
|
||||
};
|
||||
|
||||
export const getInstanceById = (id: string, layout =window.siyuan.layout.centerLayout) => {
|
||||
export const getInstanceById = (id: string, layout = window.siyuan.layout.centerLayout) => {
|
||||
const _getInstanceById = (item: Layout | Wnd, id: string) => {
|
||||
if (item.id === id) {
|
||||
return item;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue