summaryrefslogtreecommitdiffstats
path: root/jquery.multiple.select.js
diff options
context:
space:
mode:
authorFabio Kfouri <kfouri.fabio@gmail.com>2015-05-21 09:55:18 -0300
committerFabio Kfouri <kfouri.fabio@gmail.com>2015-05-21 09:55:21 -0300
commita1fb33303765df90ff92bcd78da874bfae17e983 (patch)
tree4381ef9426dcdd6b5f4395fdbe114317c6081efa /jquery.multiple.select.js
parentd4d3aa4535989205baf9cc2b42850c0c53e77a7d (diff)
downloadmultiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.zip
multiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.tar.gz
multiple-select-a1fb33303765df90ff92bcd78da874bfae17e983.tar.bz2
This improvement fix the problem described at Issue # 188, that when all child of a Group were set as true, the parent group was not set as true automatically.
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();
},