Zones Selector sorted by zone names

This change makes the Zones Selector sorted by zone names.
To address issue: renderWithZones: zone list incorrectly sorted. #354
(But this doesn't fix the problem with the scrolling)
This commit is contained in:
Alezia Kurdis 2020-05-18 23:48:02 -04:00 committed by GitHub
parent 9c96136312
commit 3a0c4e1477
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2905,7 +2905,19 @@ function getExistingZoneList() {
};
listExistingZones.push(thisZone);
}
listExistingZones.sort(GetSortOrder("name"));
return listExistingZones;
}
function GetSortOrder(sortProperty) {
return function(a, b) {
if (a[sortProperty] > b[sortProperty]) {
return 1;
} else if (a[sortProperty] < b[sortProperty]) {
return -1;
}
return 0;
}
}
}()); // END LOCAL_SCOPE