1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

fix logic of active module check

This commit is contained in:
John Mitchell 2015-06-16 16:39:20 -04:00
parent 9238d8b55d
commit 4cd5d9ab23

View File

@ -136,19 +136,14 @@ function controller($rootScope,
} }
$scope.setActiveModule = function(newModuleName, initialData) { $scope.setActiveModule = function(newModuleName, initialData) {
var isAlreadyActive = false;
for (var i in $scope.modules) {
if ($scope.modules[i].name === newModuleName &&
$scope.modules[i].isActive) {
isAlreadyActive = true;
}
}
var newModule = _.find($scope.modules, function(module) { var newModule = _.find($scope.modules, function(module) {
return module.name === newModuleName; return module.name === newModuleName;
}); });
if (!isAlreadyActive) { if (newModule.isActive) {
return;
}
$scope.modules.forEach(function(module) { $scope.modules.forEach(function(module) {
module.isActive = false; module.isActive = false;
}); });
@ -160,7 +155,6 @@ function controller($rootScope,
reloadData({ module: newModule reloadData({ module: newModule
}, initialData).value(); }, initialData).value();
}
}; };
function dateWatcher(dateProperty) { function dateWatcher(dateProperty) {