Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
Small changes to .js files
Browse files Browse the repository at this point in the history
  • Loading branch information
stefelisabeth committed Jan 15, 2018
1 parent bbb7eaa commit c88d01c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions dplace_app/static/js/controllers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ function SearchCtrl($scope, $window, $location, colorMapService, searchModelServ
break;
case 'environmental':
index = $scope.searchModel.getEnvironmentalData().selectedVariables.indexOf(object);
$scope.searchModel.getEnvironmentalData().selectedVariables.splice(index, 1);
$scope.searchModel.getEnvironmentalData().badgeValue = $scope.searchModel.getEnvironmentalData().selectedVariables.length;
if (index > -1) {
$scope.searchModel.getEnvironmentalData().selectedVariables.splice(index, 1);
$scope.searchModel.getEnvironmentalData().badgeValue = $scope.searchModel.getEnvironmentalData().selectedVariables.length;
}
break;
case 'family':
var langSelectedObjs = $scope.searchModel.getLanguageClassifications().selected;
Expand Down Expand Up @@ -126,9 +128,7 @@ function SearchCtrl($scope, $window, $location, colorMapService, searchModelServ
variable = $scope.searchModel.getEnvironmentalData().selectedVariables.map(function(v) { return v.selectedVariable.id; }).indexOf(object.variable);
if (variable > -1) {
$scope.searchModel.getEnvironmentalData().selectedVariables[variable].selectedVariable.allSelected = false;

}

}
break;
case 'variable':
Expand Down
2 changes: 1 addition & 1 deletion dplace_app/static/js/controllers/search/variable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function VariableSearchCtrl($scope, searchModelService, getCategories, Variable,
} else {
$scope.variables = searchModelService.getModel().getEnvironmentalData().selectedVariables;
if ($scope.variables.length == 0) {
$scope.variables.push({'vals': ['', ''], 'selectedFilter': $scope.filters[0], 'variables': [], 'categories': []});
$scope.variables.push({'vals': ['', ''], 'selectedFilter': $scope.filters[0], 'categories': []});
$scope.variables[0].categories = searchModelService.getModel().getEnvironmentalData().categories;
}
}
Expand Down
1 change: 0 additions & 1 deletion dplace_app/static/js/searchModelService.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ function SearchModelService(VariableCategory, GeographicRegion, LanguageFamily,
} else {
container.society.style = {'background-color': results.geographic_regions.codes[container.society.region.tdwg_code]};
}

});
}

Expand Down

0 comments on commit c88d01c

Please sign in to comment.