mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
Merge pull request #369 from AleziaKurdis/feature/zonesSelectorSorted
Zones Selector sorted by zone names
This commit is contained in:
commit
41c961198c
1 changed files with 17 additions and 0 deletions
|
@ -2905,7 +2905,24 @@ function getExistingZoneList() {
|
|||
};
|
||||
listExistingZones.push(thisZone);
|
||||
}
|
||||
listExistingZones.sort(zoneSortOrder);
|
||||
return listExistingZones;
|
||||
}
|
||||
|
||||
function zoneSortOrder(a, b) {
|
||||
var nameA = a.name.toUpperCase();
|
||||
var nameB = b.name.toUpperCase();
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
} else if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
} else if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue