mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX #5485 PermissionCheckboxSetField javascript would always uncheck all CMS_ACCESS_* permission checkboxes on initialize event
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103674 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e80b87f1c0
commit
2b851358be
@ -40,17 +40,22 @@
|
||||
* instead of custom logic.
|
||||
*/
|
||||
'.permissioncheckboxset .valCMS_ACCESS_LeftAndMain input': {
|
||||
initialize: function() {
|
||||
this.toggleCheckboxes();
|
||||
},
|
||||
onclick: function(e) {
|
||||
this.toggleCheckboxes();
|
||||
},
|
||||
toggleCheckboxes: function() {
|
||||
var checkboxes = $(this).parents('.field:eq(0)').find('li').filter(function(i) {
|
||||
getCheckboxesExceptThisOne: function() {
|
||||
return $(this).parents('.field:eq(0)').find('li').filter(function(i) {
|
||||
return ($(this).attr('class').match(/CMS_ACCESS_/));
|
||||
}).find('.checkbox').not(this);
|
||||
|
||||
},
|
||||
initialize: function() {
|
||||
var checkboxes = this.getCheckboxesExceptThisOne();
|
||||
if($(this).is(':checked')) {
|
||||
checkboxes.each(function() {
|
||||
$(this).attr('disabled', 'disabled');
|
||||
$(this).attr('checked', 'checked');
|
||||
});
|
||||
}
|
||||
},
|
||||
onclick: function(e) {
|
||||
var checkboxes = this.getCheckboxesExceptThisOne();
|
||||
if($(this).is(':checked')) {
|
||||
checkboxes.each(function() {
|
||||
$(this).attr('disabled', 'disabled');
|
||||
|
Loading…
Reference in New Issue
Block a user