From b6c1eadb9106762227e53c3fdb54ca77207a76de Mon Sep 17 00:00:00 2001 From: slhale Date: Tue, 4 Aug 2015 11:48:28 -0700 Subject: [PATCH] [Search] Generic search roots constant Made a constant for the generic search roots, rather than depending on roots[]. --- platform/search/bundle.json | 9 ++++++++- platform/search/src/GenericSearchProvider.js | 8 +------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/search/bundle.json b/platform/search/bundle.json index 9f7e9486ca..ffff9be647 100644 --- a/platform/search/bundle.json +++ b/platform/search/bundle.json @@ -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", diff --git a/platform/search/src/GenericSearchProvider.js b/platform/search/src/GenericSearchProvider.js index 977e6443e0..26897e470b 100644 --- a/platform/search/src/GenericSearchProvider.js +++ b/platform/search/src/GenericSearchProvider.js @@ -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;