mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fix JS for PermissionCheckboxsetField in SecurityAdmin
This commit is contained in:
parent
ac1658b500
commit
e69e65c1e3
@ -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'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,6 @@
|
||||
$('.permissioncheckboxset .valADMIN input').entwine({
|
||||
onmatch: function() {
|
||||
this._super();
|
||||
|
||||
this.toggleCheckboxes();
|
||||
},
|
||||
onunmatch: function() {
|
||||
this._super();
|
||||
@ -55,30 +53,29 @@
|
||||
}).find('.checkbox').not(this);
|
||||
},
|
||||
onmatch: function() {
|
||||
var checkboxes = this.getCheckboxesExceptThisOne();
|
||||
if($(this).is(':checked')) {
|
||||
checkboxes.each(function() {
|
||||
$(this).attr('disabled', 'disabled');
|
||||
$(this).attr('checked', 'checked');
|
||||
});
|
||||
}
|
||||
|
||||
this.toggleCheckboxes();
|
||||
|
||||
this._super();
|
||||
},
|
||||
onunmatch: function() {
|
||||
this._super();
|
||||
},
|
||||
onclick: function(e) {
|
||||
this.toggleCheckboxes();
|
||||
},
|
||||
toggleCheckboxes: function() {
|
||||
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