mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +00:00
implement list entries order option
This commit is contained in:
parent
3cc53b3dc7
commit
0a22d1388c
4 changed files with 26 additions and 2 deletions
|
|
@ -146,6 +146,9 @@ impl Storage {
|
|||
}
|
||||
// format dirs list
|
||||
dirs.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
if self.list_config.dir.is_reverse {
|
||||
dirs.reverse()
|
||||
}
|
||||
for dir in dirs {
|
||||
r.push({
|
||||
let dc = &self.list_config.dir; // just short alias
|
||||
|
|
@ -172,6 +175,9 @@ impl Storage {
|
|||
}
|
||||
// format files list
|
||||
files.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
if self.list_config.file.is_reverse {
|
||||
files.reverse()
|
||||
}
|
||||
for file in files {
|
||||
r.push({
|
||||
let fc = &self.list_config.file; // just short alias
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue