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:
parent
9238d8b55d
commit
4cd5d9ab23
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user