Skip to content

Commit 453620e

Browse files
committed
Do not check/uncheck disabled checkboxes in check/uncheck all checkboxes.
1 parent f95a003 commit 453620e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/jquery.checkboxes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313
* Check all checkboxes in context.
1414
*/
1515
Checkboxes.prototype.check = function () {
16-
this.$context.find(':checkbox').prop('checked', true);
16+
this.$context.find(':checkbox')
17+
.filter(':not(:disabled)')
18+
.prop('checked', true);
1719
};
1820

1921
/**
2022
* Uncheck all checkboxes in context.
2123
*/
2224
Checkboxes.prototype.uncheck = function () {
23-
this.$context.find(':checkbox').prop('checked', false);
25+
this.$context.find(':checkbox')
26+
.filter(':not(:disabled)')
27+
.prop('checked', false);
2428
};
2529

2630
/**

0 commit comments

Comments
 (0)