mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 08:14:21 +01:00
This commit is contained in:
parent
af3fdcb953
commit
235c320d91
2 changed files with 34 additions and 39 deletions
|
|
@ -196,44 +196,40 @@ export const globalCommand = (command: string, app: App) => {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
fetchPost("/api/block/checkBlockExist", {id: childData.rootId || childData.blockId}, (response) => {
|
||||
if (response.data) {
|
||||
fetchPost("/api/block/getBlockInfo", {id: childData.rootId || childData.blockId}, (infoResponse) => {
|
||||
if (infoResponse.data.rootID === (childData.rootId || childData.blockId)) {
|
||||
if (childData.instance === "Editor") {
|
||||
openFile({
|
||||
app,
|
||||
fileName: closeData.title,
|
||||
id: childData.blockId,
|
||||
rootID: childData.rootId,
|
||||
mode: childData.mode,
|
||||
rootIcon: closeData.docIcon,
|
||||
action: [childData.action]
|
||||
});
|
||||
} else if (childData.instance === "Backlink") {
|
||||
openBacklink({
|
||||
app,
|
||||
blockId: childData.blockId,
|
||||
rootId: childData.rootId,
|
||||
title: closeData.title,
|
||||
});
|
||||
} else if (childData.instance === "Graph") {
|
||||
openGraph({
|
||||
app,
|
||||
blockId: childData.blockId,
|
||||
rootId: childData.rootId,
|
||||
title: closeData.title
|
||||
});
|
||||
} else if (childData.instance === "Outline") {
|
||||
openOutline({
|
||||
app,
|
||||
rootId: childData.blockId,
|
||||
title: closeData.title,
|
||||
isPreview: childData.isPreview
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
fetchPost("/api/block/getBlockInfo", {id: childData.rootId || childData.blockId}, (infoResponse) => {
|
||||
if (infoResponse.data.rootID === (childData.rootId || childData.blockId)) {
|
||||
if (childData.instance === "Editor") {
|
||||
openFile({
|
||||
app,
|
||||
fileName: closeData.title,
|
||||
id: childData.blockId,
|
||||
rootID: childData.rootId,
|
||||
mode: childData.mode,
|
||||
rootIcon: closeData.docIcon,
|
||||
action: [childData.action]
|
||||
});
|
||||
} else if (childData.instance === "Backlink") {
|
||||
openBacklink({
|
||||
app,
|
||||
blockId: childData.blockId,
|
||||
rootId: childData.rootId,
|
||||
title: closeData.title,
|
||||
});
|
||||
} else if (childData.instance === "Graph") {
|
||||
openGraph({
|
||||
app,
|
||||
blockId: childData.blockId,
|
||||
rootId: childData.rootId,
|
||||
title: closeData.title
|
||||
});
|
||||
} else if (childData.instance === "Outline") {
|
||||
openOutline({
|
||||
app,
|
||||
rootId: childData.blockId,
|
||||
title: closeData.title,
|
||||
isPreview: childData.isPreview
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue