mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
🎨 支持列出和切换最近打开的文档 https://github.com/siyuan-note/siyuan/issues/3293
This commit is contained in:
parent
0d3bd719aa
commit
56511a96d8
1 changed files with 10 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue