mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Item list sort after amount
This commit is contained in:
1 parent
8562bccd5f
commit
82f52c6e21
1 file changed
+7
@@ -28,7 +28,14 @@ function capitalizeFirstLetter(string) {
|
||||
function hideThis(object) {
|
||||
object.style.visibility = "hidden";
|
||||
}
|
||||
function sortByKey(array, key) {
|
||||
return array.sort(function(a, b) {
|
||||
var x = Number(a[key]); var y = Number(b[key]);
|
||||
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
});
|
||||
}
|
||||
function drawcontents(data) {
|
||||
var data = sortByKey(data, "count");
|
||||
result = "<table>";
|
||||
for(i = 0;i < data.length; i++) {
|
||||
var img = "";
|
||||
|
||||
Reference in new issue
Block a user