This commit is contained in:
parent
d4de553a09
commit
8cd73f7c75
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue