Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 4f1034b

Browse files
committed
Add search-enabled option for bootstrap theme.
1 parent 9dd859d commit 4f1034b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Diff for: examples/demo-disable-search.html

+13
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@
6363

6464
<button class="btn btn-default btn-xs" ng-click="clear()">Clear ng-model</button>
6565

66+
<h3>Bootstrap theme</h3>
67+
<p>Selected: {{person.selected}}</p>
68+
<ui-select ng-model="person.selected" theme="bootstrap" search-enabled="searchEnabled" ng-disabled="disabled" style="min-width: 300px;">
69+
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
70+
<ui-select-choices repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
71+
<div ng-bind-html="person.name | highlight: $select.search"></div>
72+
<small>
73+
email: {{person.email}}
74+
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
75+
</small>
76+
</ui-select-choices>
77+
</ui-select>
78+
6679
<h3>Select2 theme</h3>
6780
<p>Selected: {{person.selected}}</p>
6881
<ui-select ng-model="person.selected" theme="select2" search-enabled="searchEnabled" ng-disabled="disabled" style="min-width: 300px;">

Diff for: src/bootstrap/match.tpl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ng-disabled="$select.disabled"
44
ng-class="{'btn-default-focus':$select.focus}";
55
ng-click="$select.activate()">
6-
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
6+
<span ng-show="$select.searchEnabled && $select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
77
<span ng-hide="$select.isEmpty()" ng-transclude></span>
88
<span class="caret"></span>
99
</button>

Diff for: src/bootstrap/select.tpl.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
class="form-control ui-select-search"
55
placeholder="{{$select.placeholder}}"
66
ng-model="$select.search"
7-
ng-show="$select.open">
7+
ng-show="$select.searchEnabled && $select.open">
88
<div class="ui-select-choices"></div>
99
</div>

0 commit comments

Comments
 (0)