Selaa lähdekoodia

:art: 反链面板中文档标题在鼠标悬浮时显示文档完整路径 https://github.com/siyuan-note/insider/issues/1088

Liang Ding 2 vuotta sitten
vanhempi
commit
ef5a911f57
2 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 1 0
      kernel/model/block.go
  2. 4 0
      kernel/model/path.go

+ 1 - 0
kernel/model/block.go

@@ -69,6 +69,7 @@ type Path struct {
 	ID       string   `json:"id"`                 // 块 ID
 	Box      string   `json:"box"`                // 块 Box
 	Name     string   `json:"name"`               // 当前路径
+	HPath    string   `json:"hPath"`              // 人类可读路径
 	Type     string   `json:"type"`               // "path"
 	NodeType string   `json:"nodeType"`           // 节点类型
 	SubType  string   `json:"subType"`            // 节点子类型

+ 4 - 0
kernel/model/path.go

@@ -120,6 +120,10 @@ func toFlatTree(blocks []*Block, baseDepth int, typ string) (ret []*Path) {
 			treeNode.Blocks = append(treeNode.Blocks, c)
 		}
 		ret = append(ret, treeNode)
+
+		if "backlink" == typ {
+			treeNode.HPath = root.HPath
+		}
 	}
 
 	sort.Slice(ret, func(i, j int) bool {