Fix #7 issue.

This commit is contained in:
Alexander Zobnin
2015-05-14 23:57:36 +03:00
parent 330d90053f
commit bdae2d6e5e

View File

@@ -65,17 +65,18 @@ function (angular, _) {
// Call when host selected // Call when host selected
$scope.selectHost = function() { $scope.selectHost = function() {
if ($scope.target.host) {
// Update item list
if ($scope.target.application) {
$scope.updateItemList($scope.target.host.hostid, $scope.target.application.applicationid);
} else {
$scope.updateItemList($scope.target.host.hostid, null);
}
// Update item list // Update application list
if ($scope.target.application) { $scope.updateAppList($scope.target.host.hostid);
$scope.updateItemList($scope.target.host.hostid, $scope.target.application.applicationid);
} else {
$scope.updateItemList($scope.target.host.hostid, null);
} }
// Update application list
$scope.updateAppList($scope.target.host.hostid);
$scope.target.errors = validateTarget($scope.target); $scope.target.errors = validateTarget($scope.target);
if (!_.isEqual($scope.oldTarget, $scope.target) && _.isEmpty($scope.target.errors)) { if (!_.isEqual($scope.oldTarget, $scope.target) && _.isEmpty($scope.target.errors)) {
$scope.oldTarget = angular.copy($scope.target); $scope.oldTarget = angular.copy($scope.target);