Filter:
@@ -105,6 +111,22 @@
var Sticky;
$(document).ready(function() {
+ $("#CheckAllFlags").on("click",function(){
+ $(".flag").attr("disabled", false);
+ $(".flag").prop("checked", true);
+ return false;
+ });
+ $("#UncheckAllFlags").on("click",function(){
+ $(".flag").attr("disabled", false);
+ $(".flag").prop("checked", false);
+ return false;
+ });
+ $(".flag").change(function(){
+ if(!$(this).is(':checked')){
+ $("input#flag-0").prop("checked", false);
+ }
+ });
+
Sticky = $("#permissions_toolbar");
Sticky.hcSticky({
stickTo: "#permissionstree",
@@ -144,12 +166,7 @@
alert(_("Inconsistency detected!") + "\n\n" + _("The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all.") + "\n\n" + _("This patron's privileges will now be reset to include only superlibrarian."));
}
- $('input[name="flag"]').each(function() {
- if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){
- $(this).prop('disabled', true);
- $(this).prop('checked', false);
- }
- });
+ setLibrarian();
}
$('input#flag-0').click(function() {
@@ -222,8 +239,17 @@
}
}
});
-
});
+
+ function setLibrarian(){
+ $('input[name="flag"]').each(function() {
+ if($(this).attr('id') != "flag-0" && !$(this).hasClass('superlib') ){
+ $(this).prop('disabled', true);
+ $(this).prop('checked', false);
+ }
+ });
+ }
+
[% END %]
--