mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
[Search] Remove unnecissary funtions
Removed isLoading, hasInput, and clear functions in favor of having the logic within the search template.
This commit is contained in:
@ -33,15 +33,15 @@ define(function () {
|
||||
function SearchController($scope, searchService, types) {
|
||||
// Starting amount of results to load. Will get increased.
|
||||
var numResults = INITIAL_LOAD_NUMBER,
|
||||
loading = false,
|
||||
fullResults = {hits: []};
|
||||
|
||||
// Scope variables are
|
||||
// $scope.results, $scope.types
|
||||
// $scope.ngModel.input, $scope.ngModel.search, $scope.ngModel.checked
|
||||
// Scope variables are:
|
||||
// results, types, loading, filtersString,
|
||||
// ngModel.input, ngModel.search, ngModel.checked
|
||||
$scope.types = [];
|
||||
$scope.ngModel.checked = {};
|
||||
$scope.filtersString = "";
|
||||
$scope.loading = false;
|
||||
|
||||
function filter(hits) {
|
||||
var newResults = [],
|
||||
@ -63,7 +63,7 @@ define(function () {
|
||||
|
||||
// We are starting to load.
|
||||
if (inputText !== '' && inputText !== undefined) {
|
||||
loading = true;
|
||||
$scope.loading = true;
|
||||
}
|
||||
|
||||
// Update whether the file tree should be displayed
|
||||
@ -90,7 +90,7 @@ define(function () {
|
||||
}
|
||||
|
||||
// Now we are done loading.
|
||||
loading = false;
|
||||
$scope.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
@ -158,14 +158,6 @@ define(function () {
|
||||
*/
|
||||
search: search,
|
||||
|
||||
/**
|
||||
* Checks to see if we are still waiting for the results to be
|
||||
* fully updated.
|
||||
*/
|
||||
isLoading: function () {
|
||||
return loading;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks to see if there are more search results to display. If the answer
|
||||
* is unclear, this function will err on there being more results.
|
||||
@ -200,24 +192,6 @@ define(function () {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines if the search bar has any text inputted into it.
|
||||
* Used as a helper for CSS styling.
|
||||
*/
|
||||
hasInput: function () {
|
||||
return !($scope.ngModel.input === "" || $scope.ngModel.input === undefined);
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears the input text.
|
||||
*/
|
||||
clear: function () {
|
||||
// Clear input field
|
||||
$scope.ngModel.input = '';
|
||||
// Call search to clear the results list too
|
||||
search();
|
||||
},
|
||||
|
||||
/**
|
||||
* Re-filters the search restuls. Called when ngModel.checked changes.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user