mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-19 08:18:05 +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);
|
||||
}
|
||||
var zoneSortProperty = "name";
|
||||
var zoneSortOrder = getSortOrder(zoneSortProperty);
|
||||
listExistingZones.sort(zoneSortOrder);
|
||||
listExistingZones.sort(zoneSortOrder());
|
||||
return listExistingZones;
|
||||
}
|
||||
|
||||
function getSortOrder(sortProperty) {
|
||||
function zoneSortOrder() {
|
||||
return function(a, b) {
|
||||
if (a[sortProperty] > b[sortProperty]) {
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
} else if (a[sortProperty] < b[sortProperty]) {
|
||||
} else if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue