mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
[Search] Comments
Updated documentation. Removed unnecissary dependency fom generic provider.
This commit is contained in:
parent
d6a7dc9820
commit
1a9dd2f144
@ -32,7 +32,7 @@
|
||||
"provides": "searchService",
|
||||
"type": "provider",
|
||||
"implementation": "providers/GenericSearchProvider.js",
|
||||
"depends": [ "$rootScope", "objectService", "workerService", "roots[]" ]
|
||||
"depends": [ "objectService", "workerService", "roots[]" ]
|
||||
},
|
||||
{
|
||||
"provides": "searchService",
|
||||
|
@ -37,6 +37,8 @@ define(
|
||||
* to be treated as one.
|
||||
*
|
||||
* @constructor
|
||||
* @param $timeout Angular's $timeout service, a replacement for
|
||||
* JavaScript's setTimeout function.
|
||||
* @param {SearchProvider[]} providers the search providers to be
|
||||
* aggregated
|
||||
*/
|
||||
|
@ -42,8 +42,9 @@ define(
|
||||
* domain objects can be gotten.
|
||||
* @param {WorkerService} workerService the service which allows
|
||||
* more easy creation of web workers.
|
||||
* @param {roots[]} roots an array of all the root domain objects.
|
||||
*/
|
||||
function GenericSearchProvider($rootScope, objectService, workerService, roots) {
|
||||
function GenericSearchProvider(objectService, workerService, roots) {
|
||||
var worker = workerService.run('genericSearchWorker'),
|
||||
latestResults = [],
|
||||
lastSearchTimestamp = 0;
|
||||
@ -62,7 +63,7 @@ define(
|
||||
|
||||
// Tell the worker to search for items it has that match this searchInput.
|
||||
// Takes the searchInput, as well as a max number of results (will return
|
||||
// less than that if there are fewer matches).
|
||||
// less than that if there are fewer matches).
|
||||
function workerSearch(searchInput, maxResults, timestamp) {
|
||||
var message = {
|
||||
request: 'search',
|
||||
@ -85,8 +86,8 @@ define(
|
||||
}
|
||||
objectService.getObjects(ids).then(function (objects) {
|
||||
var id;
|
||||
|
||||
latestResults = [];
|
||||
|
||||
for (id in objects) {
|
||||
latestResults.push({
|
||||
object: objects[id],
|
||||
|
Loading…
Reference in New Issue
Block a user