From ee1cfa23936288ad64c605cbad72400524b53e6d Mon Sep 17 00:00:00 2001 From: Matt Peel Date: Wed, 8 Jan 2014 14:55:23 +1300 Subject: [PATCH] BUGFIX: Fix SecurityAdmin checkboxes not being properly unchecked --- admin/javascript/SecurityAdmin.js | 4 ++-- javascript/PermissionCheckboxSetField.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/javascript/SecurityAdmin.js b/admin/javascript/SecurityAdmin.js index 90c494715..e169cc574 100644 --- a/admin/javascript/SecurityAdmin.js +++ b/admin/javascript/SecurityAdmin.js @@ -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'); }); } } diff --git a/javascript/PermissionCheckboxSetField.js b/javascript/PermissionCheckboxSetField.js index 5e234befe..cc20b1a42 100644 --- a/javascript/PermissionCheckboxSetField.js +++ b/javascript/PermissionCheckboxSetField.js @@ -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'); }); } }