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

Support for multi-selection #138

Merged
merged 18 commits into from
Sep 8, 2014
Merged
Show file tree
Hide file tree
Changes from 11 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
14 changes: 14 additions & 0 deletions src/bootstrap/match-multiple.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<span class="ui-select-match">
<span ng-repeat="$item in $select.selected">
<button
style="margin-right: 3px;"
class="btn btn-default btn-xs"
tabindex="-1"
ng-disabled="$select.disabled"
ng-click="$select.activeMatchIndex = $index;"
ng-class="{'btn-primary':$select.activeMatchIndex === $index}">
<span class="close" ng-hide="$select.disabled" ng-click="$select.removeChoice($index)">&nbsp;&times;</span>
<span uis-transclude-append></span>
</button>
</span>
</span>
19 changes: 19 additions & 0 deletions src/bootstrap/select-multiple.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="ui-select-multiple ui-select-bootstrap dropdown form-control" ng-class="{open: $select.open}">
<div>
<div>
<div class="ui-select-match"></div>
<input type="text"
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
class="ui-select-search input-xs"
placeholder="{{$select.getPlaceholder()}}"
ng-disabled="$select.disabled"
ng-hide="$select.disabled"
ng-click="$select.activate()"
ng-model="$select.search">
</div>
</div>
<div class="ui-select-choices"></div>
</div>
22 changes: 18 additions & 4 deletions src/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,31 @@
right: 15px;
}

.ui-select-bootstrap > .ui-select-choices {
width: 100%;
}

/* See Scrollable Menu with Bootstrap 3 http://stackoverflow.com/questions/19227496 */
.ui-select-bootstrap > .ui-select-choices {
width: 100%;
height: auto;
max-height: 200px;
overflow-x: hidden;
}

.ui-select-multiple.ui-select-bootstrap {
height: auto;
padding: .3em;
}

.ui-select-multiple.ui-select-bootstrap input.ui-select-search {
background-color: transparent !important; /* To prevent double background when disabled */
border: none;
outline: none;
height: 1.666666em;
}

.ui-select-multiple.ui-select-bootstrap .ui-select-match .close {
font-size: 1.6em;
line-height: 0.75;
}

.ui-select-bootstrap .ui-select-choices-row>a {
display: block;
padding: 3px 20px;
Expand Down
Loading