diff --git a/app/src/layout/Tab.ts b/app/src/layout/Tab.ts index c9525b6ba..57104810c 100644 --- a/app/src/layout/Tab.ts +++ b/app/src/layout/Tab.ts @@ -44,9 +44,18 @@ export class Tab { this.headElement.addEventListener("mouseenter", (event) => { event.stopPropagation(); event.preventDefault(); + let id = "" if (this.model instanceof Editor && this.model.editor?.protyle?.block?.rootID) { + id = (this.model as Editor).editor.protyle.block.rootID + } else if (!this.model){ + const initData = JSON.parse(this.headElement.getAttribute("data-initdata")||"{}") + if (initData) { + id = initData.blockId + } + } + if (id) { fetchPost("/api/filetree/getFullHPathByID", { - id: (this.model as Editor).editor.protyle.block.rootID + id }, (response) => { if (!this.headElement.getAttribute("aria-label")) { showTooltip(escapeHtml(response.data), this.headElement);