From 341218e8f60a26e0112d6db09088a54e6291b1d4 Mon Sep 17 00:00:00 2001 From: shale Date: Thu, 23 Jul 2015 16:24:38 -0700 Subject: [PATCH] [Search] Tree hide change The tree is now hidden whenever there is text in the search bar. (This allows for the case when there are no search results, but text in the search bar.) --- platform/commonUI/browse/res/templates/browse.html | 2 +- .../search/src/controllers/SearchController.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) 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;