mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 22:28:13 +00:00
[Search] Filter display
Added display below the search bar of what search filters are currently active. Not yet correctly aligned wrt search results list.
This commit is contained in:
@ -41,6 +41,7 @@ define(function () {
|
||||
// $scope.ngModel.input, $scope.ngModel.search, $scope.ngModel.checked
|
||||
$scope.types = [];
|
||||
$scope.ngModel.checked = {};
|
||||
$scope.filtersString = "";
|
||||
|
||||
function filter(hits) {
|
||||
var newResults = [],
|
||||
@ -185,13 +186,23 @@ define(function () {
|
||||
updateOptions: function () {
|
||||
var type;
|
||||
|
||||
// Update all-checked status
|
||||
// Update all-checked status and the filters string
|
||||
$scope.ngModel.checkAll = true;
|
||||
$scope.filtersString = '';
|
||||
for (type in $scope.ngModel.checked) {
|
||||
if (!$scope.ngModel.checked[type]) {
|
||||
$scope.ngModel.checkAll = false;
|
||||
} else {
|
||||
if ($scope.filtersString === '') {
|
||||
$scope.filtersString += type;
|
||||
} else {
|
||||
$scope.filtersString += ', ' + type;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($scope.ngModel.checkAll === true) {
|
||||
$scope.filtersString = '';
|
||||
}
|
||||
|
||||
// Re-filter results
|
||||
$scope.results = filter(fullResults.hits);
|
||||
|
Reference in New Issue
Block a user