[Search] Generic search roots constant

Made a constant for the generic search roots,
rather than depending on roots[].
This commit is contained in:
slhale 2015-08-04 11:48:28 -07:00
parent 56265c2277
commit b6c1eadb91
2 changed files with 9 additions and 8 deletions

View File

@ -2,12 +2,19 @@
"name": "Search",
"description": "Allows the user to search through the file tree.",
"extensions": {
"constants": [
{
"key": "GENERIC_SEARCH_ROOTS",
"value": [ "ROOT" ],
"priority": "fallback"
}
],
"components": [
{
"provides": "searchService",
"type": "provider",
"implementation": "GenericSearchProvider.js",
"depends": [ "$q", "objectService", "workerService", "roots[]" ]
"depends": [ "$q", "objectService", "workerService", "GENERIC_SEARCH_ROOTS" ]
},
{
"provides": "searchService",

View File

@ -142,14 +142,8 @@ define(
// Converts the filetree into a list
function getItems(timeout) {
var rootIds = [],
i;
for (i = 0; i < roots.length; i += 1) {
rootIds.push(roots[i].id);
}
// Aquire root objects
objectService.getObjects(rootIds).then(function (objectsById) {
objectService.getObjects(roots).then(function (objectsById) {
var objects = [],
id;