Permalink
Browse files

MINOR Fixed default state of PermissionCheckboxSetField

  • Loading branch information...
1 parent f9f6596 commit 851099d82d08d2e6921c2beabae9c61485956347 @chillu chillu committed Mar 5, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 javascript/PermissionCheckboxSetField.js
@@ -8,6 +8,11 @@
* checking all boxes is purely presentational.
*/
$('.permissioncheckboxset .valADMIN input').entwine({
+ onmatch: function() {
+ this._super();
+
+ this.toggleCheckboxes();
+ },
onclick: function(e) {
this.toggleCheckboxes();
},
@@ -26,8 +31,8 @@
// only update attributes if previous values have been saved
var oldChecked = $(this).data('SecurityAdmin.oldChecked');
var oldDisabled = $(this).data('SecurityAdmin.oldDisabled');
- if(oldChecked != null) $(this).attr('checked', oldChecked);
- if(oldDisabled != null) $(this).attr('disabled', oldDisabled);
+ if(oldChecked !== null) $(this).attr('checked', oldChecked);
+ if(oldDisabled !== null) $(this).attr('disabled', oldDisabled);
});
}
}

0 comments on commit 851099d

Please sign in to comment.