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

Add Allow-Clear support to Bootstrap Template #486

Merged
merged 1 commit into from
Dec 9, 2014
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
21 changes: 12 additions & 9 deletions src/bootstrap/match.tpl.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<button type="button" class="btn btn-default form-control ui-select-match" tabindex="-1"
ng-hide="$select.open"
ng-disabled="$select.disabled"
ng-class="{'btn-default-focus':$select.focus}";
ng-click="$select.activate()">
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
<span ng-hide="$select.isEmpty()" ng-transclude></span>
<span class="caret ui-select-toggle" ng-click="$select.toggle($event)"></span>
</button>
<div class="btn-group ui-select-match btn-block" ng-hide="$select.open" ng-disabled="$select.disabled" ng-class="{'btn-default-focus':$select.focus}">
<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()">
<span ng-show="$select.isEmpty()" class="text-muted">{{$select.placeholder}}</span>
<span ng-hide="$select.isEmpty()" ng-transclude=""></span>
</button>
<button class="btn btn-default col-sm-2 col-md-1" ng-if="$select.allowClear && !$select.isEmpty()" ng-click="$select.select(undefined)">
<span class="glyphicon glyphicon-remove ui-select-toggle"></span>
</button>
<button class="btn btn-default col-sm-2 col-md-1" ng-click="$select.activate()">
<span class="caret ui-select-toggle" ng-click="$select.toggle($event)"></span>
</button>
</div>
4 changes: 2 additions & 2 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('ui-select tests', function() {
}

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

function clickItem(el, text) {
Expand All @@ -97,7 +97,7 @@ describe('ui-select tests', function() {
}

function clickMatch(el) {
$(el).find('.ui-select-match').click();
$(el).find('.ui-select-match > button:first').click();
scope.$digest();
}

Expand Down