From 58ed4085019526141be07beeada37788dfe2d316 Mon Sep 17 00:00:00 2001 From: Casey Holzer Date: Thu, 7 Apr 2016 08:18:03 -0600 Subject: [PATCH] support using a string for maxOptionsText --- js/bootstrap-select.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/bootstrap-select.js b/js/bootstrap-select.js index 86bf24c1a..6582d9184 100644 --- a/js/bootstrap-select.js +++ b/js/bootstrap-select.js @@ -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 = $('
');