Kaynağa Gözat

:bug: fix https://github.com/siyuan-note/siyuan/issues/5683

Vanessa 2 yıl önce
ebeveyn
işleme
8cd73f7c75
1 değiştirilmiş dosya ile 10 ekleme ve 1 silme
  1. 10 1
      app/src/layout/Tab.ts

+ 10 - 1
app/src/layout/Tab.ts

@@ -44,9 +44,18 @@ export class Tab {
             this.headElement.addEventListener("mouseenter", (event) => {
             this.headElement.addEventListener("mouseenter", (event) => {
                 event.stopPropagation();
                 event.stopPropagation();
                 event.preventDefault();
                 event.preventDefault();
+                let id = ""
                 if (this.model instanceof Editor && this.model.editor?.protyle?.block?.rootID) {
                 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", {
                     fetchPost("/api/filetree/getFullHPathByID", {
-                        id: (this.model as Editor).editor.protyle.block.rootID
+                        id
                     }, (response) => {
                     }, (response) => {
                         if (!this.headElement.getAttribute("aria-label")) {
                         if (!this.headElement.getAttribute("aria-label")) {
                             showTooltip(escapeHtml(response.data), this.headElement);
                             showTooltip(escapeHtml(response.data), this.headElement);