summaryrefslogtreecommitdiffstats
path: root/jquery.multiple.select.js
diff options
context:
space:
mode:
authorzhixin <wenzhixin2010@gmail.com>2015-11-24 16:42:47 +0800
committerzhixin <wenzhixin2010@gmail.com>2015-11-24 16:42:47 +0800
commitaa06bb62b397ad6eef3076bf5e6322e7dae2e4d5 (patch)
tree727b28bf3afcaef9b213afdb046fe156d30b6f66 /jquery.multiple.select.js
parentcfdab0e9eec70592a5c1a33760b7f87211325094 (diff)
downloadmultiple-select-aa06bb62b397ad6eef3076bf5e6322e7dae2e4d5.zip
multiple-select-aa06bb62b397ad6eef3076bf5e6322e7dae2e4d5.tar.gz
multiple-select-aa06bb62b397ad6eef3076bf5e6322e7dae2e4d5.tar.bz2
Fix #236: single select bug.
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r--jquery.multiple.select.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index d45f31f..545a28d 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -290,6 +290,16 @@
if (that.options.single && that.options.isOpen && !that.options.keepOpen) {
that.close();
}
+
+ if (that.options.single) {
+ var clickedVal = $(this).val();
+ that.$selectItems.filter(function() {
+ return $(this).val() == clickedVal ? false : true;
+ }).each(function() {
+ $(this).prop('checked', false);
+ });
+ that.update();
+ }
});
},