mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Code Adjustment
Code Adjustment { ... listExistingZones.sort(zoneSortOrder()); return listExistingZones; } function zoneSortOrder() { return function(a, b) { if (a.name > b.name) { return 1; } else if (a.name < b.name) { return -1; } return 0; } }
This commit is contained in:
parent
3023924cf1
commit
e6d092aefe
1 changed files with 4 additions and 6 deletions
|
@ -2905,17 +2905,15 @@ function getExistingZoneList() {
|
||||||
};
|
};
|
||||||
listExistingZones.push(thisZone);
|
listExistingZones.push(thisZone);
|
||||||
}
|
}
|
||||||
var zoneSortProperty = "name";
|
listExistingZones.sort(zoneSortOrder());
|
||||||
var zoneSortOrder = getSortOrder(zoneSortProperty);
|
|
||||||
listExistingZones.sort(zoneSortOrder);
|
|
||||||
return listExistingZones;
|
return listExistingZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSortOrder(sortProperty) {
|
function zoneSortOrder() {
|
||||||
return function(a, b) {
|
return function(a, b) {
|
||||||
if (a[sortProperty] > b[sortProperty]) {
|
if (a.name > b.name) {
|
||||||
return 1;
|
return 1;
|
||||||
} else if (a[sortProperty] < b[sortProperty]) {
|
} else if (a.name < b.name) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue