diff --git a/platform/commonUI/browse/res/templates/browse.html b/platform/commonUI/browse/res/templates/browse.html
index d926044f7e..5af59e43e0 100644
--- a/platform/commonUI/browse/res/templates/browse.html
+++ b/platform/commonUI/browse/res/templates/browse.html
@@ -35,7 +35,7 @@
+ ng-hide="treeModel.search">
diff --git a/platform/features/search/src/controllers/SearchController.js b/platform/features/search/src/controllers/SearchController.js
index 70edf748fe..d0a4f0a2fb 100644
--- a/platform/features/search/src/controllers/SearchController.js
+++ b/platform/features/search/src/controllers/SearchController.js
@@ -56,13 +56,6 @@ define(function () {
// We got the latest results now (and done loading)
loading = false;
$scope.results = searchService.getLatestResults(0, numResults);
-
- // Update whether the file tree should be displayed
- if ($scope.results.length === 0) {
- $scope.ngModel.filter = false;
- } else {
- $scope.ngModel.filter = true;
- }
}
}
waitForLatest();
@@ -73,6 +66,13 @@ define(function () {
timestamp = date.getTime(),
inputText = document.getElementById(inputID).value;
+ // Update whether the file tree should be displayed
+ if (inputText === '') {
+ $scope.ngModel.search = false;
+ } else {
+ $scope.ngModel.search = true;
+ }
+
// Reset 'load more'
numResults = INITIAL_LOAD_NUMBER;