From 3a0c4e1477d10f7cd41fc41cf48e73d7dfbc3620 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Mon, 18 May 2020 23:48:02 -0400 Subject: [PATCH] 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) --- scripts/system/create/edit.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 969b03e795..2e4bb44242 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -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