Properly fix SecurityAdmin Groups javascript checkbox toggling.

This commit is contained in:
Matt Peel 2014-01-09 08:47:41 +13:00
parent ee1cfa2393
commit aec29bf8c8
2 changed files with 12 additions and 12 deletions

View File

@ -60,15 +60,15 @@
if(this.is(':checked')) {
checkboxes.each(function() {
$(this).data('SecurityAdmin.oldChecked', $(this).attr('checked'));
$(this).data('SecurityAdmin.oldDisabled', $(this).attr('disabled'));
$(this).attr('disabled', 'disabled');
$(this).attr('checked', 'checked');
$(this).data('SecurityAdmin.oldChecked', $(this).is(':checked'));
$(this).data('SecurityAdmin.oldDisabled', $(this).is(':disabled'));
$(this).prop('disabled', true);
$(this).prop('checked', true);
});
} else {
checkboxes.each(function() {
$(this).attr('checked', $(this).data('SecurityAdmin.oldChecked') === 'checked');
$(this).attr('disabled', $(this).data('SecurityAdmin.oldDisabled') === 'disabled');
$(this).prop('checked', $(this).data('SecurityAdmin.oldChecked'));
$(this).prop('disabled', $(this).data('SecurityAdmin.oldDisabled'));
});
}
}

View File

@ -72,15 +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');
$(this).data('PermissionCheckboxSetField.oldChecked', $(this).is(':checked'));
$(this).data('PermissionCheckboxSetField.oldDisabled', $(this).is(':disabled'));
$(this).prop('disabled', 'disabled');
$(this).prop('checked', 'checked');
});
} else {
checkboxes.each(function() {
$(this).attr('checked', $(this).data('PermissionCheckboxSetField.oldChecked') === 'checked');
$(this).attr('disabled', $(this).data('PermissionCheckboxSetField.oldDisabled') === 'disabled');
$(this).prop('checked', $(this).data('PermissionCheckboxSetField.oldChecked'));
$(this).prop('disabled', $(this).data('PermissionCheckboxSetField.oldDisabled'));
});
}
}