summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <e.marguin@agence-codecouleurs.fr>2014-07-10 14:58:38 +0200
committereric <e.marguin@agence-codecouleurs.fr>2014-07-10 14:58:38 +0200
commite6f165b2d7b85d62826144a9a5960a133e4e564f (patch)
treec8a87905a3d30ab6c74db3c07a2af25283d82e14
parent3ccc20af49791df36473df698191738b159157ab (diff)
downloadmultiple-select-e6f165b2d7b85d62826144a9a5960a133e4e564f.zip
multiple-select-e6f165b2d7b85d62826144a9a5960a133e4e564f.tar.gz
multiple-select-e6f165b2d7b85d62826144a9a5960a133e4e564f.tar.bz2
option etcaetera
-rw-r--r--jquery.multiple.select.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index ca35770..ec082c9 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -313,9 +313,16 @@
selects.length === this.$selectItems.length + this.$disableItems.length) {
$span.removeClass('placeholder').html(this.options.allSelected);
} else if (this.options.countSelected && selects.length > this.options.minumimCountSelected) {
- $span.removeClass('placeholder').html(this.options.countSelected
- .replace('#', selects.length)
- .replace('%', this.$selectItems.length + this.$disableItems.length));
+ if(this.options.etcaetera)
+ {
+ $span.removeClass('placeholder').html((this.options.displayValues ? selects : this.getSelects('text').slice(0, this.options.minumimCountSelected)).join(this.options.delimiter)+'...');
+ }
+ else
+ {
+ $span.removeClass('placeholder').html(this.options.countSelected
+ .replace('#', selects.length)
+ .replace('%', this.$selectItems.length + this.$disableItems.length));
+ }
} else {
$span.removeClass('placeholder').html(
(this.options.displayValues ? selects : this.getSelects('text'))