[Search] Hide tree

The tree is hidden when there are
search results.
This commit is contained in:
shale 2015-07-23 15:55:20 -07:00
parent f4d34a2a9c
commit 7d495f6389
3 changed files with 14 additions and 7 deletions

View File

@ -28,13 +28,14 @@
>
<mct-representation key="'create-button'" mct-object="navigatedObject">
</mct-representation>
<div class='search-holder'>
<div class='holder search-holder abs'>
<mct-include key="'search'"
mct-object="domainObject"
ng-model="treeModel">
</mct-include>
</div>
<div class='holder tree-holder abs'>
<div class='holder tree-holder abs'
ng-hide="treeModel.filter">
<mct-representation key="'tree'"
mct-object="domainObject"
ng-model="treeModel">

View File

@ -23,15 +23,14 @@
ng-controller="SearchController as controller">
<!-- Search bar input -->
<div>
<!--input class="search-input"
<input class="search-input"
id="searchbarinput"
type="text"
value=""
ng-keyup="controller.search('searchbarinput')" /-->
a
<mct-control key="searchbar"
ng-keyup="controller.search('searchbarinput')" />
<!--mct-control key="searchbar"
ng-keyup="controller.search('searchbarinput')">asdf
</mct-control>
</mct-control-->
</div>
<!-- This div exists to determine scroll bar location -->

View File

@ -56,6 +56,13 @@ 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();