[Search] 'All' selected upon no filters. Fixes #1117

Upon deselecting every filter, the search returns nothing. This serves 
no useful purpose as discussed in #1117. Now deselecting every filter 
automatically selects 'All'.
This commit is contained in:
Kevin Van Kessel
2016-08-22 12:52:34 -07:00
committed by GitHub
parent eb3b6e5eca
commit e29efbbcdf

View File

@@ -80,7 +80,7 @@ define(function () {
// If there's still nothing in the filters string, there are no // If there's still nothing in the filters string, there are no
// filters selected // filters selected
if ($scope.ngModel.filtersString === '') { if ($scope.ngModel.filtersString === '') {
$scope.ngModel.filtersString = 'NONE'; $scope.ngModel.checkAll = true;
} }
} }
@@ -95,12 +95,11 @@ define(function () {
$scope.ngModel.checked[type] = false; $scope.ngModel.checked[type] = false;
}); });
// Change the filters string depending on checkAll status // This setting will make the filters display hidden
if ($scope.ngModel.checkAll) { $scope.ngModel.filtersString = '';
// This setting will make the filters display hidden // Do not let checkAll become unchecked when it is the only checked filter
$scope.ngModel.filtersString = ''; if (!$scope.ngModel.checkAll) {
} else { $scope.ngModel.checkAll = true;
$scope.ngModel.filtersString = 'NONE';
} }
// Re-filter results // Re-filter results