summaryrefslogtreecommitdiffstats
path: root/jquery.multiple.select.js
diff options
context:
space:
mode:
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r--jquery.multiple.select.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index b8f2338..7fd5549 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -416,6 +416,14 @@
});
this.$selectAll.prop('checked', this.$selectItems.length ===
this.$selectItems.filter(':checked').length);
+
+ $.each(that.$selectGroups, function (i, val) {
+ var group = $(val).parent().attr('data-group'),
+ $children = that.$selectItems.filter('[data-group="' + group + '"]');
+ $(val).prop('checked', $children.length &&
+ $children.length === $children.filter(':checked').length);
+ });
+
this.update();
},