mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-11 01:34:20 +01:00
🎨 支持按子文档数排序 Fix https://github.com/siyuan-note/siyuan/issues/6030
This commit is contained in:
parent
18ad07d2f4
commit
890d01a368
9 changed files with 56 additions and 17 deletions
|
|
@ -365,6 +365,10 @@ func ListDocTree(boxID, path string, sortMode int) (ret []*File, totals int, err
|
|||
sort.Slice(docs, func(i, j int) bool { return docs[i].Size < docs[j].Size })
|
||||
case util.SortModeSizeDESC:
|
||||
sort.Slice(docs, func(i, j int) bool { return docs[i].Size > docs[j].Size })
|
||||
case util.SortModeSubDocCountASC:
|
||||
sort.Slice(docs, func(i, j int) bool { return docs[i].SubFileCount < docs[j].SubFileCount })
|
||||
case util.SortModeSubDocCountDESC:
|
||||
sort.Slice(docs, func(i, j int) bool { return docs[i].SubFileCount > docs[j].SubFileCount })
|
||||
}
|
||||
|
||||
if util.SortModeCustom != sortMode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue