Chromium Code Reviews| Index: gm/rebaseline_server/static/loader.js |
| =================================================================== |
| --- gm/rebaseline_server/static/loader.js (revision 11659) |
| +++ gm/rebaseline_server/static/loader.js (working copy) |
| @@ -34,6 +34,7 @@ |
| function($scope, $http, $filter) { |
| $http.get("/results/all").then( |
| function(response) { |
| + $scope.header = response.data.header; |
| $scope.categories = response.data.categories; |
| $scope.testData = response.data.testData; |
| $scope.sortColumn = 'test'; |
| @@ -41,11 +42,26 @@ |
| $scope.hiddenResultTypes = [ |
| 'failure-ignored', 'no-comparison', 'succeeded']; |
| $scope.hiddenConfigs = []; |
| + $scope.selectedItems = []; |
|
jcgregorio
2013/10/09 14:41:48
Making this an {} would simplify the code since yo
epoger
2013/10/09 15:35:30
Great idea! Done.
|
| $scope.updateResults(); |
| } |
| ); |
| + $scope.isItemSelected = function(index) { |
| + return ($scope.selectedItems.indexOf(index) >= 0); |
|
jcgregorio
2013/10/09 14:41:48
If you don't switch to using a map, then this shou
epoger
2013/10/09 15:35:30
Switched to map.
|
| + } |
| + $scope.toggleItemSelected = function(index) { |
| + var i = $scope.selectedItems.indexOf(index); |
| + if (i >= 0) { |
| + $scope.selectedItems.splice(i, 1); |
| + } else { |
| + $scope.selectedItems.push(index); |
| + } |
| + // unlike other toggle methods below, does not set |
| + // $scope.areUpdatesPending = true; |
| + } |
| + |
| $scope.isHiddenResultType = function(thisResultType) { |
| return ($scope.hiddenResultTypes.indexOf(thisResultType) >= 0); |
| } |