Seph Soliman avatar Seph Soliman committed 6b3969f

clients and projects are now sorted

Comments (0)

Files changed (1)

 		}
 	});
 	
+	var allCompanies_sorted = [];
+	for(var i in allCompanies) {
+		allCompanies_sorted.push(allCompanies[i]);
+	}
+	allCompanies_sorted.sort(function(a,b) { return a.name.localeCompare(b.name) });
+	
 	// * setup the drop down
 	console.log('setting up projects drop down');
 	$("#projects").html('<option value="" disabled="disabled">Select a project &raquo;</option>');
-	for(var i in allCompanies) {
-		var cmp = allCompanies[i];
+	for(var i = 0; i < allCompanies_sorted.length; i++) {
+		var cmp = allCompanies_sorted[i];
 		var projects = cmp.getProjects();
+		var cmpProjects_sorted = [];
+		for(var j in projects) {
+			cmpProjects_sorted.push(projects[j]);
+		}
+		cmpProjects_sorted.sort(function(a,b) { return a.name.localeCompare(b.name) });
 		$("#projects").append('<option value="" disabled="disabled">'+cmp.name+'</option>');
-		for(var i in projects) {
-			var prj = projects[i];
+		for(var j = 0; j < cmpProjects_sorted.length; j++) {
+			var prj = cmpProjects_sorted[j];
 			$("#projects").append('<option value="'+prj.id+'">&nbsp;&nbsp;'+prj.name+'</option>');
 		}
 	}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.