Sort files by numeric values
Some checks failed
Publish Docker rootless image / Push Docker image to Docker Hub (push) Failing after 1m0s
Publish Docker image / Push Docker image to Docker Hub (push) Failing after 39s
Some checks failed
Publish Docker rootless image / Push Docker image to Docker Hub (push) Failing after 1m0s
Publish Docker image / Push Docker image to Docker Hub (push) Failing after 39s
This commit is contained in:
parent
b41f20f0cc
commit
5be1cd5d65
1 changed files with 4 additions and 2 deletions
|
@ -94,8 +94,10 @@ $(document).ready(function () {
|
||||||
} else if (sortBy === "name") {
|
} else if (sortBy === "name") {
|
||||||
console.log("sort by name");
|
console.log("sort by name");
|
||||||
|
|
||||||
|
var collator = new Intl.Collator([], {numeric: true});
|
||||||
filesData.sort(function (fileA, fileB) {
|
filesData.sort(function (fileA, fileB) {
|
||||||
return fileA.name.toLowerCase().localeCompare(fileB.name.toLowerCase());
|
return collator.compare(fileA.name.toLowerCase(), fileB.name.toLowerCase());
|
||||||
|
//return fileA.name.toLowerCase().localeCompare(fileB.name.toLowerCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (sortBy === "size") {
|
} else if (sortBy === "size") {
|
||||||
|
|
Loading…
Reference in a new issue