Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/examples/demo-header-and-footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<h3>Basic Header and Footer</h3>
<button class="btn btn-default btn-xs" ng-click="ctrl.enable()">Enable ui-select</button>
<button class="btn btn-default btn-xs" ng-click="ctrl.disable()">Disable ui-select</button>
<button class="btn btn-default btn-xs" ng-click="ctrl.clear()">Clear ng-model</button>

<h3>Bootstrap theme <small>(remote data source)</small></h3>
<p>Selected: {{ctrl.address.selected.formatted_address}}</p>
<ui-select ng-model="ctrl.address.selected"
theme="bootstrap"
ng-disabled="ctrl.disabled"
reset-search-input="false"
style="width: 300px;"
title="Choose an address">
<ui-select-match placeholder="Enter an address...">{{$select.selected.formatted_address}}</ui-select-match>
<ui-select-header>Header text</ui-select-header>
<ui-select-choices repeat="address in ctrl.addresses track by $index"
refresh="ctrl.refreshAddresses($select.search)"
refresh-delay="0">
<div ng-bind-html="address.formatted_address | highlight: $select.search"></div>
</ui-select-choices>
<ui-select-footer>Footer text</ui-select-footer>
</ui-select>

<h3>Select2 theme</h3>
<p>Selected: {{ctrl.person.selected}}</p>
<ui-select ng-model="ctrl.person.selected" theme="select2" ng-disabled="ctrl.disabled" style="min-width: 300px;" title="Choose a person">
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
<ui-select-header>Header text</ui-select-header>
<ui-select-choices repeat="person in ctrl.people | propsFilter: {name: $select.search, age: $select.search}">
<div ng-bind-html="person.name | highlight: $select.search"></div>
<small>
email: {{person.email}}
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
</small>
</ui-select-choices>
<ui-select-footer>Footer text</ui-select-footer>
</ui-select>

<h3>Selectize theme</h3>
<p>Selected: {{ctrl.country.selected}}</p>
<ui-select ng-model="ctrl.country.selected" theme="selectize" ng-disabled="ctrl.disabled" style="width: 300px;" title="Choose a country">
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-header>Header text</ui-select-header>
<ui-select-choices repeat="country in ctrl.countries | filter: $select.search">
<span ng-bind-html="country.name | highlight: $select.search"></span>
<small ng-bind-html="country.code | highlight: $select.search"></small>
</ui-select-choices>
<ui-select-footer>Footer text</ui-select-footer>
</ui-select>
3 changes: 1 addition & 2 deletions src/bootstrap/choices.tpl.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<ul class="ui-select-choices ui-select-choices-content ui-select-dropdown dropdown-menu"
ng-show="$select.open && $select.items.length > 0">
<ul class="ui-select-choices ui-select-choices-content">
<li class="ui-select-choices-group" id="ui-select-choices-{{ $select.generatedId }}" >
<div class="divider" ng-show="$select.isGrouped && $index > 0"></div>
<div ng-show="$select.isGrouped" class="ui-select-choices-group-label dropdown-header" ng-bind="$group.name"></div>
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/footer.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="ui-select-footer" ng-transclude></div>
1 change: 1 addition & 0 deletions src/bootstrap/header.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="ui-select-header" ng-transclude></div>
6 changes: 5 additions & 1 deletion src/bootstrap/select-multiple.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
ng-class="{'spinner': $select.refreshing}"
ondrop="return false;">
</div>
<div class="ui-select-choices"></div>
<div ng-show="$select.open && $select.items.length > 0" class="ui-select-dropdown dropdown-menu">
<div class="ui-select-header"></div>
<div class="ui-select-choices"></div>
<div class="ui-select-footer"></div>
</div>
<div class="ui-select-no-choice"></div>
</div>
6 changes: 5 additions & 1 deletion src/bootstrap/select.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
placeholder="{{$select.placeholder}}"
ng-model="$select.search"
ng-show="$select.open">
<div class="ui-select-choices"></div>
<div ng-show="$select.open && $select.items.length > 0" class="ui-select-dropdown dropdown-menu">
<div class="ui-select-header"></div>
<div class="ui-select-choices"></div>
<div class="ui-select-footer"></div>
</div>
<div class="ui-select-no-choice"></div>
</div>
Loading