Commit eb469cb2 authored by David Stutz's avatar David Stutz

Merge pull request #177 from daftgopher/number_displayed

Add 'numberDisplayed' default to multiselect and use that to determine w...
parents 1bf82fcd c6a317bf
......@@ -57,14 +57,14 @@
// Default options.
defaults: {
// Default text function will either print 'None selected' in case no
// option is selected, or a list of the selected options up to a length of 3 selected options.
// option is selected, or a list of the selected options up to a length of 3 selected options by default.
// If more than 3 options are selected, the number of selected options is printed.
buttonText: function(options, select) {
if (options.length == 0) {
return this.nonSelectedText + ' <b class="caret"></b>';
}
else {
if (options.length > 3) {
if (options.length > this.numberDisplayed) {
return options.length + ' ' + this.nSelectedText + ' <b class="caret"></b>';
}
else {
......@@ -117,7 +117,8 @@
filterBehavior: 'text',
preventInputChangeEvent: false,
nonSelectedText: 'None selected',
nSelectedText: 'selected'
nSelectedText: 'selected',
numberDisplayed: 3
},
// Templates.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment