Browse files

MDL-32150 Libraries: checkall and uncheckall will not select disabled…

… or readonly checkboxes
  • Loading branch information...
1 parent a280078 commit af8def57f6f5f43bae482e7e3892492dea2d3413 @rajeshtaneja rajeshtaneja committed Mar 22, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/javascript-static.js
View
6 lib/javascript-static.js
@@ -796,6 +796,9 @@ function checkall() {
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
+ if (inputs[i].disabled || inputs[i].readOnly) {
+ continue;
+ }
inputs[i].checked = true;
}
}
@@ -805,6 +808,9 @@ function checknone() {
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'checkbox') {
+ if (inputs[i].disabled || inputs[i].readOnly) {
+ continue;
+ }
inputs[i].checked = false;
}
}

0 comments on commit af8def5

Please sign in to comment.