diff --git a/ui/scripts/ui-custom/projectSelect.js b/ui/scripts/ui-custom/projectSelect.js index ba4c7c73d23..5cb444978aa 100644 --- a/ui/scripts/ui-custom/projectSelect.js +++ b/ui/scripts/ui-custom/projectSelect.js @@ -30,11 +30,21 @@ response: { success: function(args) { var projects = args.data; + var arrayOfProjs = []; $(projects).map(function(index, project) { + var proj = {id: _s(project.id), html: _s(project.displaytext ? project.displaytext : project.name)}; + arrayOfProjs.push(proj); + }); + + arrayOfProjs.sort(function(a,b) { + return a.html.localeCompare(b.html); + }); + + $(arrayOfProjs).map(function(index, project) { var $option = $('