mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 19:27:07 +00:00
[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:
parent
33e8084852
commit
341218e8f6
@ -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">
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user