diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts index a6bb99417..f9dff97c2 100644 --- a/app/src/protyle/toolbar/index.ts +++ b/app/src/protyle/toolbar/index.ts @@ -26,6 +26,7 @@ import {blockRender} from "../markdown/blockRender"; /// #if !BROWSER import {clipboard, nativeImage, NativeImage} from "electron"; import {getCurrentWindow} from "@electron/remote"; +import {openBy} from "../../editor/util"; /// #endif import {fetchPost} from "../../util/fetch"; import {isArrayEqual, isBrowser, isMobile} from "../../util/functions"; @@ -1202,7 +1203,15 @@ export class Toolbar { }, (response) => { let html = ""; response.data.blocks.forEach((item: { path: string, content: string }, index: number) => { - html += `
${item.content}
`; + html += `
+${item.content}`; + /// #if !BROWSER + html += ` + +
`; + /// #else + html += ""; + /// #endif }); if (html === "") { html = `
  • ${window.siyuan.languages.emptyContent}
  • `; @@ -1273,11 +1282,17 @@ export class Toolbar { focusByRange(this.range); return; } - const listElement = hasClosestByClassName(target, "b3-list-item"); - if (!listElement) { + /// #if !BROWSER + const iconElement = hasClosestByClassName(target, "b3-list-item__action"); + if (iconElement) { + openBy(iconElement.parentElement.getAttribute("data-value"), "folder"); return; } - hintRenderTemplate(decodeURIComponent(listElement.getAttribute("data-value")), protyle, nodeElement); + /// #endif + const listElement = hasClosestByClassName(target, "b3-list-item"); + if (listElement) { + hintRenderTemplate(decodeURIComponent(listElement.getAttribute("data-value")), protyle, nodeElement); + } }); const rangePosition = getSelectionPosition(nodeElement, range); this.subElement.classList.remove("fn__none");