diff --git a/platform/search/src/controllers/SearchController.js b/platform/search/src/controllers/SearchController.js index 0a49e1adf5..1ecccd5c2d 100644 --- a/platform/search/src/controllers/SearchController.js +++ b/platform/search/src/controllers/SearchController.js @@ -42,6 +42,12 @@ define(function () { // We are starting to load. loading = true; + // Update whether the file tree should be displayed + // Hide tree only when starting search + if (inputText !== '' && inputText !== undefined) { + $scope.ngModel.search = true; + } + if (!maxResults) { // Reset 'load more' numResults = INITIAL_LOAD_NUMBER; @@ -53,10 +59,9 @@ define(function () { $scope.results = result.hits.slice(0, numResults); // Update whether the file tree should be displayed + // Reveal tree only when finishing search if (inputText === '' || inputText === undefined) { $scope.ngModel.search = false; - } else { - $scope.ngModel.search = true; } // Now we are done loading.