Commit 48c1fb06 authored by Joe Vu's avatar Joe Vu

Fixed "All Selected" problem on non-multiselect with one option

There’s some situation when there are only one option and that displays
“All selected” which is only correct if the select tag is “multiple”.
In using this plugin for “single” dropdowns as well, there are
situations when there’s only one option and it shouldn’t show “All
selected”. This fixes that
parent 8b201843
......@@ -197,7 +197,11 @@
if (options.length === 0) {
return this.nonSelectedText;
}
else if (this.allSelectedText && options.length == $('option', $(select)).length) {
else if (this.allSelectedText
&& options.length === $('option', $(select)).length
&& $('option', $(select)).length !== 1
&& this.multiple) {
if (this.selectAllNumber) {
return this.allSelectedText + ' (' + options.length + ')';
}
......
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