This commit is contained in:
Vanessa 2023-02-07 11:41:25 +08:00
parent 94f623f82a
commit aefd33d6b8

View file

@ -76,13 +76,18 @@ export class Breadcrumb {
event.preventDefault(); event.preventDefault();
break; break;
} else if (target.getAttribute("data-type") === "context") { } else if (target.getAttribute("data-type") === "context") {
event.preventDefault();
if (protyle.block.rootID === protyle.options.blockId) {
target.classList.toggle("block__icon--active")
return;
}
if (target.classList.contains("block__icon--active")) { if (target.classList.contains("block__icon--active")) {
fetchPost("/api/filetree/getDoc", { fetchPost("/api/filetree/getDoc", {
id: protyle.options.blockId, id: protyle.options.blockId,
mode: 0, mode: 0,
size: window.siyuan.config.editor.dynamicLoadBlocks, size: window.siyuan.config.editor.dynamicLoadBlocks,
}, getResponse => { }, getResponse => {
onGet(getResponse, protyle); onGet(getResponse, protyle, [Constants.CB_GET_ALL]);
}); });
target.classList.remove("block__icon--active"); target.classList.remove("block__icon--active");
} else { } else {
@ -95,7 +100,6 @@ export class Breadcrumb {
}); });
target.classList.add("block__icon--active"); target.classList.add("block__icon--active");
} }
event.preventDefault();
break; break;
} }
target = target.parentElement; target = target.parentElement;