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

Commit a7062fa

Browse files
committed
Handle disabled attribute with Bootstrap theme
1 parent 178c4df commit a7062fa

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

examples/bootstrap.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@
7272

7373
</div>
7474
</div>
75+
76+
<div class="form-group">
77+
<label class="col-sm-3 control-label">Disabled</label>
78+
<div class="col-sm-6">
79+
80+
<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="true">
81+
<match placeholder="Select or search a person in the list...">{{$select.selected.name}}</match>
82+
<choices repeat="item in people | filter: $select.search">
83+
<div ng-bind-html="trustAsHtml((item.name | highlight: $select.search))"></div>
84+
<small ng-bind-html="trustAsHtml((item.email | highlight: $select.search))"></small>
85+
</choices>
86+
</ui-select>
87+
88+
</div>
89+
</div>
90+
7591
</fieldset>
7692
</form>
7793

src/bootstrap/choices.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ul class="ui-select-choices ui-select-choices-content dropdown-menu" role="menu" aria-labelledby="dLabel">
22
<li class="ui-select-choices-row" ng-class="{active: $select.activeIdx == $index}">
3-
<a ng-transclude></a>
3+
<a ng-transclude></a>
44
</li>
55
</ul>

src/bootstrap/match.tpl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<a class="btn btn-default ui-select-match"
22
ng-hide="$select.open"
33
ng-class="{'text-success': $select.selected == undefined}"
4+
ng-disabled="$select.disabled"
45
ng-click="$select.activate()">
56
<span ng-hide="$select.selected" class="text-muted">{{placeholder}}</span>
67
<span ng-show="$select.selected" ng-transclude></span>

src/bootstrap/select.tpl.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<div class="dropdown" ng-class="{open:$select.open}">
2-
<div class="ui-select-match"
3-
ng-click="$select.activate()"></div>
4-
<input type="text" class="form-control ui-select-search" autocomplete="off" tabindex="" placeholder="{{$select.placeholder}}"
5-
ng-model="$select.search"
6-
ng-show="$select.open">
1+
<div class="dropdown" ng-class="{open: $select.open}">
2+
<div class="ui-select-match" ng-click="$select.activate()"></div>
3+
<input type="text" autocomplete="off" tabindex=""
4+
class="form-control ui-select-search"
5+
placeholder="{{$select.placeholder}}"
6+
ng-model="$select.search"
7+
ng-show="$select.open">
78
<div class="ui-select-choices"></div>
89
</div>

0 commit comments

Comments
 (0)