X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Ftestbeds%2Fstatic%2Fjs%2Ftestbeds.js;h=1050f54875ce548480fa7000daf1eed9769e42bd;hb=7be53c6362c016ae34052a8a751ca11a975b0bd0;hp=e628a679fcbaf16a0b5ff79316559422e99f291c;hpb=1c6f984f4e2e6c218f50eab40c3b93fe4ddc4802;p=myslice.git diff --git a/plugins/testbeds/static/js/testbeds.js b/plugins/testbeds/static/js/testbeds.js index e628a679..1050f548 100644 --- a/plugins/testbeds/static/js/testbeds.js +++ b/plugins/testbeds/static/js/testbeds.js @@ -58,30 +58,34 @@ { var selected, prev_selected, num, num_selected, num_prev_selected, filter; - prev_selected = $.map($scope.facility_names, function(x, i) { - return $scope.is_facility_active(x) ? x : null; - }); + // prev_selected = $.map($scope.facility_names, function(x, i) { + // return $scope.is_facility_active(x) ? x : null; + // }); $scope.set_facility_active(facility, ! $scope.is_facility_active(facility)); - - selected = $.map($scope.facility_names, function(x, i) { - return $scope.is_facility_active(x) ? x : null; + + $.each($scope.testbed_names[facility], function(j, testbed_name) { + $scope.select_testbed(facility, testbed_name); }); - - num = $scope.facility_names.length; - prev_num_selected = prev_selected.length; - num_selected = selected.length; - - if ((prev_num_selected != 0) && (prev_num_selected != num)) { - // Remove previous filter - filter = ['facility_name', 'included', prev_selected]; - manifold.raise_event($scope.instance.options.query_uuid, FILTER_REMOVED, filter); - } - - if (num_selected != num) { - filter = ['facility_name', 'included', selected]; - manifold.raise_event($scope.instance.options.query_uuid, FILTER_ADDED, filter); - } + console.log($scope); + // selected = $.map($scope.facility_names, function(x, i) { + // return $scope.is_facility_active(x) ? x : null; + // }); + + // num = $scope.facility_names.length; + // prev_num_selected = prev_selected.length; + // num_selected = selected.length; + + // if ((prev_num_selected != 0) && (prev_num_selected != num)) { + // // Remove previous filter + // filter = ['facility_name', 'included', prev_selected]; + // manifold.raise_event($scope.instance.options.query_uuid, FILTER_REMOVED, filter); + // } +// + // if (num_selected != num) { + // filter = ['facility_name', 'included', selected]; + // manifold.raise_event($scope.instance.options.query_uuid, FILTER_ADDED, filter); + // } }; $scope.select_testbed = function(facility, testbed) @@ -240,7 +244,7 @@ _get_scope : function() { - return angular.element('[ng-controller=TestbedsCtrl]').scope() + return angular.element('[ng-controller=TestbedsCtrl]').scope(); }, /*