summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jquery.multiple.select.js12
-rw-r--r--multiple-select.jquery.json55
2 files changed, 38 insertions, 29 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index b8b8d16..672c438 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -1,6 +1,6 @@
/**
* @author zhixin wen <wenzhixin2010@gmail.com>
- * @version 1.0.3
+ * @version 1.0.4
*
* http://wenzhixin.net.cn/p/multiple-select/
*/
@@ -136,8 +136,14 @@
that.filter();
});
this.$selectAll.off('click').on('click', function() {
- var $items = that.$selectItems.filter(':visible');
- that[$(this).prop('checked') ? 'checkAll' : 'uncheckAll']();
+ var checked = $(this).prop('checked'),
+ $items = that.$selectItems.filter(':visible');
+ if ($items.length === that.$selectItems.length) {
+ that[checked ? 'checkAll' : 'uncheckAll']();
+ } else { // when the filter option is true
+ $items.prop('checked', checked);
+ that.update();
+ }
});
this.$selectGroups.off('click').on('click', function() {
var group = $(this).attr('data-group'),
diff --git a/multiple-select.jquery.json b/multiple-select.jquery.json
index f3c9900..2a3c125 100644
--- a/multiple-select.jquery.json
+++ b/multiple-select.jquery.json
@@ -1,28 +1,31 @@
{
- "name": "multiple-select",
- "version": "1.0.3",
- "title": "Multiple Select",
- "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).",
- "author": {
- "name": "zhixin wen",
- "email": "wenzhixin2010@gmail.com",
- "url": "http://wenzhixin.net.cn/"
- },
- "licenses": [
- {
- "type": "GPL",
- "url": "LICENSE"
- }
- ],
- "dependencies": {
- "jquery": ">=1.7"
- },
- "keywords": ["multiple.select", "select.list", "multiple.choose", "checkbox"],
- "homepage": "http://wenzhixin.net.cn/p/multiple-select/",
- "demo": "http://wenzhixin.net.cn/p/multiple-select/#examples",
- "bugs": {
- "url": "https://github.com/wenzhixin/multiple-select/issues"
- },
- "docs": "http://wenzhixin.net.cn/p/multiple-select/#documentation",
- "download": "https://github.com/wenzhixin/multiple-select/archive/master.zip"
+ "name": "multiple-select",
+ "version": "1.0.4",
+ "title": "Multiple Select",
+ "description": "Multiple select is a jQuery plugin to select multiple elements with checkboxes :).",
+ "author": {
+ "name": "zhixin wen",
+ "email": "wenzhixin2010@gmail.com",
+ "url": "http://wenzhixin.net.cn/"
+ },
+ "licenses": [
+ {
+ "type": "Apache License",
+ "url": "http://www.apache.org/licenses/LICENSE-2.0"
+ }, {
+ "type": "GPL",
+ "url": "http://www.gnu.org/licenses/gpl-2.0.html"
+ }
+ ],
+ "dependencies": {
+ "jquery": ">=1.6"
+ },
+ "keywords": ["multiple.select", "select.list", "multiple.choose", "checkbox"],
+ "homepage": "http://wenzhixin.net.cn/p/multiple-select/",
+ "demo": "http://wenzhixin.net.cn/p/multiple-select/#examples",
+ "bugs": {
+ "url": "https://github.com/wenzhixin/multiple-select/issues"
+ },
+ "docs": "http://wenzhixin.net.cn/p/multiple-select/#documentation",
+ "download": "https://github.com/wenzhixin/multiple-select/archive/master.zip"
} \ No newline at end of file