BUGFIX: Fix SecurityAdmin checkboxes not being properly unchecked

This commit is contained in:
Matt Peel 2014-01-08 14:55:23 +13:00
parent ac1658b500
commit ee1cfa2393
2 changed files with 6 additions and 4 deletions

View File

@ -67,8 +67,8 @@
});
} else {
checkboxes.each(function() {
$(this).attr('checked', $(this).data('SecurityAdmin.oldChecked'));
$(this).attr('disabled', $(this).data('SecurityAdmin.oldDisabled'));
$(this).attr('checked', $(this).data('SecurityAdmin.oldChecked') === 'checked');
$(this).attr('disabled', $(this).data('SecurityAdmin.oldDisabled') === 'disabled');
});
}
}

View File

@ -72,13 +72,15 @@
var checkboxes = this.getCheckboxesExceptThisOne();
if($(this).is(':checked')) {
checkboxes.each(function() {
$(this).data('PermissionCheckboxSetField.oldChecked', $(this).attr('checked'));
$(this).data('PermissionCheckboxSetField.oldDisabled', $(this).attr('disabled'));
$(this).attr('disabled', 'disabled');
$(this).attr('checked', 'checked');
});
} else {
checkboxes.each(function() {
$(this).prop('checked', false);
$(this).prop('disabled', false);
$(this).attr('checked', $(this).data('PermissionCheckboxSetField.oldChecked') === 'checked');
$(this).attr('disabled', $(this).data('PermissionCheckboxSetField.oldDisabled') === 'disabled');
});
}
}