From 011545035d35bc66135b24167650bc37686a5eda Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Tue, 3 Sep 2013 08:38:10 -0400 Subject: [PATCH] Lates UI changes --- awx/ui/static/js/helpers/Hosts.js | 24 ++-------- awx/ui/static/js/helpers/inventory.js | 66 ++++++++++++++------------- 2 files changed, 37 insertions(+), 53 deletions(-) diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index 8349b4a88b..0792e85be6 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -460,34 +460,16 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H }]) - .factory('LoadSearchTree', ['Rest', 'GetBasePath', 'ProcessErrors', '$compile', '$rootScope', 'Wait', - function(Rest, GetBasePath, ProcessErrors, $compile, $rootScope, Wait) { + .factory('LoadSearchTree', ['Rest', 'GetBasePath', 'ProcessErrors', '$compile', '$rootScope', 'Wait', 'SortNodes', + function(Rest, GetBasePath, ProcessErrors, $compile, $rootScope, Wait, SortNodes) { return function(params) { var scope = params.scope; var inventory_id = params.inventory_id; var html = ''; - function sortNodes(data) { - //Sort nodes by name - var names = []; - var newData = []; - for (var i=0; i < data.length; i++) { - names.push(data[i].name); - } - names.sort(); - for (var j=0; j < names.length; j++) { - for (i=0; i < data.length; i++) { - if (data[i].name == names[j]) { - newData.push(data[i]); - } - } - } - return newData; - } - function buildHTML(tree_data) { - var sorted = sortNodes(tree_data); + var sorted = SortNodes(tree_data); html += (sorted.length > 0) ? "