From 37027088fd7cf4d4b73d47406cb59e09783cd1c8 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Fri, 19 Jul 2013 16:01:41 -0400 Subject: [PATCH] AC-229 Multie-select now working --- awx/ui/static/js/helpers/Selection.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/js/helpers/Selection.js b/awx/ui/static/js/helpers/Selection.js index 8f50bef6bf..075a2344e3 100644 --- a/awx/ui/static/js/helpers/Selection.js +++ b/awx/ui/static/js/helpers/Selection.js @@ -122,8 +122,21 @@ angular.module('SelectionHelper', ['Utilities', 'RestServices']) } scope.SelectPostRefreshRemove = scope.$on('PostRefresh', function() { for (var i=0; i < scope[list.name].length; i++) { - scope[list.name][i]['checked'] = '0'; - scope[list.name][i]['success_class'] = ''; + var found = false; + for (var j=0; j < scope.selected.length; j++) { + if (scope.selected[j].id == scope[list.name][i].id) { + found = true; + break; + } + } + if (found) { + scope[list.name][i]['checked'] = '1'; + scope[list.name][i]['success_class'] = 'success'; + } + else { + scope[list.name][i]['checked'] = '0'; + scope[list.name][i]['success_class'] = ''; + } } }); }