[Search] Declare UI components as templates

Declare Search UI components as templates instead of
representations so that they are not removed from the
DOM when no domain object is supplied. Fixes
nasa/openmctweb#234
This commit is contained in:
Victor Woeltjen 2015-11-02 14:07:22 -08:00
parent ec56fe7bfd
commit 0dccaab9cb
3 changed files with 12 additions and 11 deletions

View File

@ -34,10 +34,9 @@
</mct-representation>
<div class='holder search-holder abs'
ng-class="{active: treeModel.search}">
<mct-representation key="'search'"
mct-object="domainObject"
<mct-include key="'search'"
ng-model="treeModel">
</mct-representation>
</mct-include>
</div>
<div class='tree-holder abs mobile-tree-holder'
ng-hide="treeModel.search">

View File

@ -27,6 +27,12 @@
}
],
"representations": [
{
"key": "search-item",
"templateUrl": "templates/search-item.html"
}
],
"templates": [
{
"key": "search",
"templateUrl": "templates/search.html"
@ -34,10 +40,6 @@
{
"key": "search-menu",
"templateUrl": "templates/search-menu.html"
},
{
"key": "search-item",
"templateUrl": "templates/search-item.html"
}
],
"components": [

View File

@ -43,7 +43,7 @@
<a class="ui-symbol clear-icon"
ng-class="{content: !(ngModel.input === '' || ngModel.input === undefined)}"
ng-click="ngModel.input = ''; controller.search()">
&#xe607;
&#xe607;
</a>
<!-- Menu icon/button 'v' -->
@ -53,12 +53,12 @@
</a>
<!-- Menu -->
<mct-representation key="'search-menu'"
<mct-include key="'search-menu'"
class="menu-element search-menu-holder"
ng-class="{off: !toggle.isActive()}"
ng-model="ngModel"
ng-click="toggle.setState(true)">
</mct-representation>
</mct-include>
</div>
<!-- Active filter display -->
@ -71,7 +71,7 @@
&#xe607;
</a>
Filtered by: {{ ngModel.filtersString }}
Filtered by: {{ ngModel.filtersString }}
</div>