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

Commit 6e94894

Browse files
Daniel ClausenDaniel Clausen
Daniel Clausen
authored and
Daniel Clausen
committed
Add Allow-Clear support to Bootstrap Template
1 parent bea7631 commit 6e94894

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/bootstrap/match.tpl.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
<button type="button" class="btn btn-default form-control ui-select-match" tabindex="-1"
2-
ng-hide="$select.open"
3-
ng-disabled="$select.disabled"
4-
ng-class="{'btn-default-focus':$select.focus}";
5-
ng-click="$select.activate()">
6-
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
7-
<span ng-hide="$select.isEmpty()" ng-transclude></span>
8-
<span class="caret ui-select-toggle" ng-click="$select.toggle($event)"></span>
9-
</button>
1+
<div class="btn-group ui-select-match btn-block" ng-hide="$select.open" ng-disabled="$select.disabled" ng-class="{'btn-default-focus':$select.focus}">
2+
<button type="button" class="btn btn-default" ng-class="{'col-sm-8 col-md-10': $select.allowClear && !$select.isEmpty(),'col-sm-10 col-md-11': !$select.allowClear || $select.isEmpty()}" tabindex="-1" ;="" ng-click="$select.activate()">
3+
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
4+
<span ng-hide="$select.isEmpty()" ng-transclude=""></span>
5+
</button>
6+
<button class="btn btn-default col-sm-2 col-md-1" ng-if="$select.allowClear && !$select.isEmpty()" ng-click="$select.select(undefined)">
7+
<span class="glyphicon glyphicon-remove ui-select-toggle"></span>
8+
</button>
9+
<button class="btn btn-default col-sm-2 col-md-1" ng-click="$select.activate()">
10+
<span class="caret ui-select-toggle" ng-click="$select.toggle($event)"></span>
11+
</button>
12+
</div>

test/select.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('ui-select tests', function() {
8383
}
8484

8585
function getMatchLabel(el) {
86-
return $(el).find('.ui-select-match > span[ng-transclude]:not(.ng-hide)').text();
86+
return $(el).find('.ui-select-match > button:first > span[ng-transclude]:not(.ng-hide)').text();
8787
}
8888

8989
function clickItem(el, text) {
@@ -97,7 +97,7 @@ describe('ui-select tests', function() {
9797
}
9898

9999
function clickMatch(el) {
100-
$(el).find('.ui-select-match').click();
100+
$(el).find('.ui-select-match > button:first').click();
101101
scope.$digest();
102102
}
103103

0 commit comments

Comments
 (0)