mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🚨
This commit is contained in:
parent
d9813b016f
commit
640f3396f2
1 changed files with 13 additions and 13 deletions
|
|
@ -24,11 +24,11 @@ const updateTitle = (rootID: string, tab: Tab) => {
|
||||||
fetchPost("/api/block/getDocInfo", {
|
fetchPost("/api/block/getDocInfo", {
|
||||||
id: rootID
|
id: rootID
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
tab.updateTitle(response.data.name)
|
tab.updateTitle(response.data.name);
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: string[] }) => {
|
export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: string[] }) => {
|
||||||
const allModels = getAllModels()
|
const allModels = getAllModels();
|
||||||
allModels.editor.forEach(item => {
|
allModels.editor.forEach(item => {
|
||||||
if (data.upsertRootIDs.includes(item.editor.protyle.block.rootID)) {
|
if (data.upsertRootIDs.includes(item.editor.protyle.block.rootID)) {
|
||||||
reloadProtyle(item.editor.protyle);
|
reloadProtyle(item.editor.protyle);
|
||||||
|
|
@ -36,7 +36,7 @@ export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: strin
|
||||||
} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {
|
} else if (data.removeRootIDs.includes(item.editor.protyle.block.rootID)) {
|
||||||
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.graph.forEach(item => {
|
allModels.graph.forEach(item => {
|
||||||
if (item.type === "local" && data.removeRootIDs.includes(item.rootId)) {
|
if (item.type === "local" && data.removeRootIDs.includes(item.rootId)) {
|
||||||
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
||||||
|
|
@ -46,7 +46,7 @@ export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: strin
|
||||||
updateTitle(item.rootId, item.parent);
|
updateTitle(item.rootId, item.parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.outline.forEach(item => {
|
allModels.outline.forEach(item => {
|
||||||
if (item.type === "local" && data.removeRootIDs.includes(item.blockId)) {
|
if (item.type === "local" && data.removeRootIDs.includes(item.blockId)) {
|
||||||
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
||||||
|
|
@ -60,7 +60,7 @@ export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: strin
|
||||||
updateTitle(item.blockId, item.parent);
|
updateTitle(item.blockId, item.parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.backlink.forEach(item => {
|
allModels.backlink.forEach(item => {
|
||||||
if (item.type === "local" && data.removeRootIDs.includes(item.rootId)) {
|
if (item.type === "local" && data.removeRootIDs.includes(item.rootId)) {
|
||||||
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
item.parent.parent.removeTab(item.parent.id, false, false, false);
|
||||||
|
|
@ -70,21 +70,21 @@ export const reloadSync = (data: { upsertRootIDs: string[], removeRootIDs: strin
|
||||||
updateTitle(item.rootId, item.parent);
|
updateTitle(item.rootId, item.parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.files.forEach(item => {
|
allModels.files.forEach(item => {
|
||||||
item.init(false);
|
item.init(false);
|
||||||
})
|
});
|
||||||
allModels.bookmark.forEach(item => {
|
allModels.bookmark.forEach(item => {
|
||||||
item.update();
|
item.update();
|
||||||
})
|
});
|
||||||
allModels.tag.forEach(item => {
|
allModels.tag.forEach(item => {
|
||||||
item.update();
|
item.update();
|
||||||
})
|
});
|
||||||
// NOTE asset 无法获取推送地址,先不处理
|
// NOTE asset 无法获取推送地址,先不处理
|
||||||
allModels.search.forEach(item => {
|
allModels.search.forEach(item => {
|
||||||
item.parent.panelElement.querySelector("#searchRefresh").dispatchEvent(new CustomEvent("input"));
|
item.parent.panelElement.querySelector("#searchRefresh").dispatchEvent(new CustomEvent("input"));
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
export const lockScreen = () => {
|
export const lockScreen = () => {
|
||||||
if (window.siyuan.config.readonly) {
|
if (window.siyuan.config.readonly) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue