mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
[Search] Moved isLoading
Moved the isLoading function away from the aggregator. It is now the controller's responsibility. Corresponding tests updated.
This commit is contained in:
@ -33,11 +33,15 @@ define(function () {
|
||||
function SearchController($scope, searchService) {
|
||||
// Starting amount of results to load. Will get increased.
|
||||
var numResults = INITIAL_LOAD_NUMBER,
|
||||
loading = false,
|
||||
fullResults = [];
|
||||
|
||||
function search() {
|
||||
var inputText = $scope.ngModel.input;
|
||||
|
||||
// We are starting to load.
|
||||
loading = true;
|
||||
|
||||
// Update whether the file tree should be displayed
|
||||
if (inputText === '' || inputText === undefined) {
|
||||
$scope.ngModel.search = false;
|
||||
@ -52,6 +56,9 @@ define(function () {
|
||||
searchService.query(inputText).then(function (result) {
|
||||
fullResults = result.hits;
|
||||
$scope.results = result.hits.slice(0, numResults);
|
||||
|
||||
// Now we are done loading.
|
||||
loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
@ -67,7 +74,7 @@ define(function () {
|
||||
* fully updated.
|
||||
*/
|
||||
isLoading: function () {
|
||||
return searchService.isLoading();
|
||||
return loading;
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user