[Search] Comments

Updated documentation. Removed unnecissary dependency
fom generic provider.
This commit is contained in:
slhale 2015-07-28 11:33:29 -07:00
parent d6a7dc9820
commit 1a9dd2f144
3 changed files with 7 additions and 4 deletions

View File

@ -32,7 +32,7 @@
"provides": "searchService",
"type": "provider",
"implementation": "providers/GenericSearchProvider.js",
"depends": [ "$rootScope", "objectService", "workerService", "roots[]" ]
"depends": [ "objectService", "workerService", "roots[]" ]
},
{
"provides": "searchService",

View File

@ -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
*/

View File

@ -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],