Skip to content

Commit

Permalink
Fix #7 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed May 14, 2015
1 parent 330d900 commit bdae2d6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions zabbix/queryCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ function (angular, _) {

// Call when host selected
$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
if ($scope.target.application) {
$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);
}

// Update application list
$scope.updateAppList($scope.target.host.hostid);

$scope.target.errors = validateTarget($scope.target);
if (!_.isEqual($scope.oldTarget, $scope.target) && _.isEmpty($scope.target.errors)) {
$scope.oldTarget = angular.copy($scope.target);
Expand Down

0 comments on commit bdae2d6

Please sign in to comment.