mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2760 from madmatt/pulls/securityadmin-js
BUGFIX: Fix SecurityAdmin checkboxes not being properly unchecked
This commit is contained in:
commit
c84d9ee00c
@ -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'));
|
||||
$(this).attr('disabled', $(this).data('SecurityAdmin.oldDisabled'));
|
||||
$(this).prop('checked', $(this).data('SecurityAdmin.oldChecked'));
|
||||
$(this).prop('disabled', $(this).data('SecurityAdmin.oldDisabled'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -72,13 +72,15 @@
|
||||
var checkboxes = this.getCheckboxesExceptThisOne();
|
||||
if($(this).is(':checked')) {
|
||||
checkboxes.each(function() {
|
||||
$(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).prop('checked', false);
|
||||
$(this).prop('disabled', false);
|
||||
$(this).prop('checked', $(this).data('PermissionCheckboxSetField.oldChecked'));
|
||||
$(this).prop('disabled', $(this).data('PermissionCheckboxSetField.oldDisabled'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user