[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.)
This commit is contained in:
shale 2015-07-23 16:24:38 -07:00
parent 33e8084852
commit 341218e8f6
2 changed files with 8 additions and 8 deletions

View File

@ -35,7 +35,7 @@
</mct-include>
</div>
<div class='holder tree-holder abs'
ng-hide="treeModel.filter">
ng-hide="treeModel.search">
<mct-representation key="'tree'"
mct-object="domainObject"
ng-model="treeModel">

View File

@ -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;