mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 08:30:48 +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",
|
"provides": "searchService",
|
||||||
"type": "provider",
|
"type": "provider",
|
||||||
"implementation": "providers/GenericSearchProvider.js",
|
"implementation": "providers/GenericSearchProvider.js",
|
||||||
"depends": [ "$rootScope", "objectService", "workerService", "roots[]" ]
|
"depends": [ "objectService", "workerService", "roots[]" ]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"provides": "searchService",
|
"provides": "searchService",
|
||||||
|
@ -37,6 +37,8 @@ define(
|
|||||||
* to be treated as one.
|
* to be treated as one.
|
||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @param $timeout Angular's $timeout service, a replacement for
|
||||||
|
* JavaScript's setTimeout function.
|
||||||
* @param {SearchProvider[]} providers the search providers to be
|
* @param {SearchProvider[]} providers the search providers to be
|
||||||
* aggregated
|
* aggregated
|
||||||
*/
|
*/
|
||||||
|
@ -42,8 +42,9 @@ define(
|
|||||||
* domain objects can be gotten.
|
* domain objects can be gotten.
|
||||||
* @param {WorkerService} workerService the service which allows
|
* @param {WorkerService} workerService the service which allows
|
||||||
* more easy creation of web workers.
|
* 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'),
|
var worker = workerService.run('genericSearchWorker'),
|
||||||
latestResults = [],
|
latestResults = [],
|
||||||
lastSearchTimestamp = 0;
|
lastSearchTimestamp = 0;
|
||||||
@ -62,7 +63,7 @@ define(
|
|||||||
|
|
||||||
// Tell the worker to search for items it has that match this searchInput.
|
// 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
|
// 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) {
|
function workerSearch(searchInput, maxResults, timestamp) {
|
||||||
var message = {
|
var message = {
|
||||||
request: 'search',
|
request: 'search',
|
||||||
@ -85,8 +86,8 @@ define(
|
|||||||
}
|
}
|
||||||
objectService.getObjects(ids).then(function (objects) {
|
objectService.getObjects(ids).then(function (objects) {
|
||||||
var id;
|
var id;
|
||||||
|
|
||||||
latestResults = [];
|
latestResults = [];
|
||||||
|
|
||||||
for (id in objects) {
|
for (id in objects) {
|
||||||
latestResults.push({
|
latestResults.push({
|
||||||
object: objects[id],
|
object: objects[id],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user