mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-04-26 04:48:27 -05:00
🎨 支持列出和切换最近打开的文档 https://github.com/siyuan-note/siyuan/issues/3293
This commit is contained in:
+10
-12
@@ -29,13 +29,12 @@ import (
|
||||
)
|
||||
|
||||
type RecentDoc struct {
|
||||
RootID string `json:"rootID"`
|
||||
ID string `json:"id"`
|
||||
Icon string `json:"icon"`
|
||||
Title string `json:"title"`
|
||||
ScrollAttr string `json:"scrollAttr"`
|
||||
Mode string `json:"mode"`
|
||||
Action string `json:"action"`
|
||||
RootID string `json:"rootID"`
|
||||
ID string `json:"id"`
|
||||
Icon string `json:"icon"`
|
||||
Title string `json:"title"`
|
||||
Mode string `json:"mode"`
|
||||
Action string `json:"action"`
|
||||
}
|
||||
|
||||
var recentDocLock = sync.Mutex{}
|
||||
@@ -66,11 +65,10 @@ func RemoveRecentDoc(ids []string) {
|
||||
|
||||
func SetRecentDocByTree(id string, tree *parse.Tree) {
|
||||
recentDoc := &RecentDoc{
|
||||
RootID: tree.Root.ID,
|
||||
ID: id,
|
||||
Icon: tree.Root.IALAttr("icon"),
|
||||
Title: tree.Root.IALAttr("title"),
|
||||
ScrollAttr: tree.Root.IALAttr("scroll"),
|
||||
RootID: tree.Root.ID,
|
||||
ID: id,
|
||||
Icon: tree.Root.IALAttr("icon"),
|
||||
Title: tree.Root.IALAttr("title"),
|
||||
}
|
||||
|
||||
SetRecentDoc(recentDoc)
|
||||
|
||||
Reference in New Issue
Block a user