diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts index d58862c05..82fbfd364 100644 --- a/app/src/protyle/breadcrumb/index.ts +++ b/app/src/protyle/breadcrumb/index.ts @@ -36,16 +36,11 @@ export class Breadcrumb { const element = document.createElement("div"); element.className = "protyle-breadcrumb"; const isFocus = protyle.options.action.includes(Constants.CB_GET_ALL) && !isMobile(); - let html = `
+ element.innerHTML = `
`; - if (protyle.options.render.breadcrumbContext) { - html += ` -
`; - } - element.innerHTML = html; this.element = element.firstElementChild as HTMLElement; element.addEventListener("click", (event) => { let target = event.target as HTMLElement; @@ -77,18 +72,8 @@ export class Breadcrumb { break; } 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")) { - fetchPost("/api/filetree/getDoc", { - id: protyle.options.blockId, - mode: 0, - size: window.siyuan.config.editor.dynamicLoadBlocks, - }, getResponse => { - onGet(getResponse, protyle, [Constants.CB_GET_ALL]); - }); + zoomOut(protyle, protyle.options.blockId); target.classList.remove("block__icon--active"); } else { fetchPost("/api/filetree/getDoc", { @@ -97,6 +82,9 @@ export class Breadcrumb { size: window.siyuan.config.editor.dynamicLoadBlocks, }, getResponse => { onGet(getResponse, protyle, [Constants.CB_GET_HL]); + const exitFocusElement = this.element.parentElement.querySelector('[data-type="exit-focus"]'); + exitFocusElement.classList.add("fn__none"); + exitFocusElement.nextElementSibling.classList.add("fn__none"); }); target.classList.add("block__icon--active"); }