mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-29 08:34:50 +02:00
sort entries in refresh, not NavDir.get_children()
This commit is contained in:
parent
7d1f9df49b
commit
defaf5d1ce
@ -568,14 +568,6 @@ class NavDir extends NavEntry {
|
||||
break;
|
||||
}
|
||||
});
|
||||
children.sort((first, second) => {
|
||||
if (first.nav_type === second.nav_type) {
|
||||
return first.filename().localeCompare(second.filename());
|
||||
}
|
||||
if (first.nav_type === "dir")
|
||||
return -1;
|
||||
return 1;
|
||||
});
|
||||
return children;
|
||||
}
|
||||
|
||||
@ -723,6 +715,14 @@ class NavWindow {
|
||||
var entry = this.entries.pop();
|
||||
entry.destroy();
|
||||
}
|
||||
files.sort((first, second) => {
|
||||
if (first.nav_type === second.nav_type) {
|
||||
return first.filename().localeCompare(second.filename());
|
||||
}
|
||||
if (first.nav_type === "dir")
|
||||
return -1;
|
||||
return 1;
|
||||
});
|
||||
files.forEach((file) => {
|
||||
if (file.nav_type === "dir")
|
||||
num_dirs++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user