This commit is contained in:
Vanessa 2022-08-20 11:04:18 +08:00
parent d4de553a09
commit 8cd73f7c75

View file

@ -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);