Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option showTick #1272

Merged
merged 2 commits into from
Jan 28, 2016
Merged
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
7 changes: 4 additions & 3 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@
actionsBox: false,
iconBase: 'glyphicon',
tickIcon: 'glyphicon-ok',
showTick: false,
template: {
caret: '<span class="caret"></span>'
},
Expand Down Expand Up @@ -378,8 +379,8 @@

createDropdown: function () {
// Options
// If we are multiple, then add the show-tick class by default
var multiple = this.multiple ? ' show-tick' : '',
// If we are multiple or showTick option is set, then add the show-tick class
var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '',
autofocus = this.autofocus ? ' autofocus' : '';
// Elements
Expand Down Expand Up @@ -412,7 +413,7 @@
'</div>'
: '';
var drop =
'<div class="btn-group bootstrap-select' + multiple + inputGroup + '">' +
'<div class="btn-group bootstrap-select' + showTick + inputGroup + '">' +
'<button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + autofocus + '>' +
'<span class="filter-option pull-left"></span>&nbsp;' +
'<span class="bs-caret">' +
Expand Down