diff options
author | zhixin <wenzhixin2010@gmail.com> | 2015-11-24 16:42:47 +0800 |
---|---|---|
committer | zhixin <wenzhixin2010@gmail.com> | 2015-11-24 16:42:47 +0800 |
commit | aa06bb62b397ad6eef3076bf5e6322e7dae2e4d5 (patch) | |
tree | 727b28bf3afcaef9b213afdb046fe156d30b6f66 /jquery.multiple.select.js | |
parent | cfdab0e9eec70592a5c1a33760b7f87211325094 (diff) | |
download | multiple-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.js | 10 |
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(); + } }); }, |