Skip to content

Commit

Permalink
support using a string for maxOptionsText
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed Apr 7, 2016
1 parent 701f19e commit 58ed408
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/bootstrap-select.js
Expand Up @@ -1209,8 +1209,8 @@
that.$menuInner.find('[data-optgroup="' + optgroupID + '"]').removeClass('selected');
that.setSelected(clickedIndex, true);
} else {
var maxOptionsArr = (typeof that.options.maxOptionsText === 'function') ?
that.options.maxOptionsText(maxOptions, maxOptionsGrp) : that.options.maxOptionsText,
var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,
maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,
maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),
maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),
$notify = $('<div class="notify"></div>');
Expand Down

0 comments on commit 58ed408

Please sign in to comment.