mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 17:15:16 +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;
|
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;
|
return children;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,6 +715,14 @@ class NavWindow {
|
|||||||
var entry = this.entries.pop();
|
var entry = this.entries.pop();
|
||||||
entry.destroy();
|
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) => {
|
files.forEach((file) => {
|
||||||
if (file.nav_type === "dir")
|
if (file.nav_type === "dir")
|
||||||
num_dirs++;
|
num_dirs++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user