From 2c76b1269c1880356ec2327a59007338091fa617 Mon Sep 17 00:00:00 2001
From: Jason Etheridge <jason@esilibrary.com>
Date: Thu, 11 Oct 2012 12:35:58 -0400
Subject: [PATCH] sort hostnames listed in login window

for those of us with a lot of hosts to deal with :)

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Ben Shum <bshum@biblio.org>
---
 Open-ILS/xul/staff_client/chrome/content/auth/controller.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
index 071fc665fb..d437a7a7c4 100644
--- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
+++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
@@ -147,10 +147,15 @@ auth.controller.prototype = {
                         ['render'],
                         function(e) {
                             return function() {
+                                var list = [];
                                 for (var s in obj.data.ws_info) {
+                                    list.push(s);
+                                }
+                                list.sort();
+                                for (var i = 0; i < list.length; i++) {
                                     var mi = document.createElement('menuitem');
-                                    mi.setAttribute('label',s);
-                                    mi.setAttribute('value',s);
+                                    mi.setAttribute('label',list[i]);
+                                    mi.setAttribute('value',list[i]);
                                     e.appendChild(mi);
                                 }
                             };
-- 
2.11.0