From c717a719d83b502abb10cdfe66a393cec55bfed5 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 12 Nov 2008 16:59:43 +0100 Subject: [PATCH] Adding javascript to let user click table cell to check containing checkbox. This is a usability improvement as it widens the target of the click. The script for moremember.pl includes code necessary to uncheck its sibling as per uncheck_sibling(). If this patch is approved I will look for other instances so that interactions will be consistent. Signed-off-by: Galen Charlton --- .../prog/en/modules/circ/circulation.tmpl | 20 ++++++++++- .../prog/en/modules/members/moremember.tmpl | 34 +++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index e2df2026c6..a2560b42af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -6,6 +6,7 @@ + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index c6f5d85635..73b3f65090 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -35,12 +35,34 @@ $(document).ready(function() { return confirm('Are you sure you want to replace the current patron image? This cannot be undone.'); } }); - $("#renew_all").click(function(){ $(".checkboxed").checkCheckboxes(":not(input[@name*=barcodes])"); $(".checkboxed").unCheckCheckboxes(":not(input[@name*=items])"); }); - $("#return_all").click(function(){ $(".checkboxed").checkCheckboxes(":not(input[@name*=items])"); $(".checkboxed").unCheckCheckboxes(":not(input[@name*=barcodes])"); }); - $("#CheckAllitems").click(function(){ $(".checkboxed").checkCheckboxes(":not(input[@name*=barcodes])"); $(".checkboxed").unCheckCheckboxes(":not(input[@name*=items])"); return false; }); - $("#CheckNoitems").click(function(){ $(".checkboxed").unCheckCheckboxes(":not(input[@name*=barcodes])"); return false; }); - $("#CheckAllreturns").click(function(){ $(".checkboxed").checkCheckboxes(":not(input[@name*=items])"); $(".checkboxed").unCheckCheckboxes(":not(input[@name*=barcodes])"); return false; }); - $("#CheckNoreturns").click(function(){ $(".checkboxed").unCheckCheckboxes(":not(input[@name*=items])"); return false; }); + $("#renew_all").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); }); + $("#return_all").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); }); + $("#CheckAllitems").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=items]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); + $("#CheckNoitems").click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); return false; }); + $("#CheckAllreturns").click(function(){ $(".checkboxed").checkCheckboxes(":input[@name*=barcodes]"); $(".checkboxed").unCheckCheckboxes(":input[@name*=items]"); return false; }); + $("#CheckNoreturns").click(function(){ $(".checkboxed").unCheckCheckboxes(":input[@name*=barcodes]"); return false; }); + + + $( '#override_limit' ).click( function () { + if ( this.checked ) { + $( '.renewals-allowed' ).show(); $( '.renewals-disabled' ).hide(); + } else { + $( '.renewals-allowed' ).hide(); $( '.renewals-disabled' ).show(); + } + } ).attr( 'checked', false ); + + $("td").click(function(e){ + if(e.target.tagName.toLowerCase() == 'td'){ + $(this).find("input:checkbox").each( function() { + $(this).attr('checked', !$(this).attr('checked')); + if($(this).attr('checked')){ + $(this).parent().siblings().find("input:checkbox").each(function(){ + if($(this).attr('checked')){ $(this).attr('checked',''); } + }); + } + }); + } + }); }); function uncheck_sibling(me){ nodename=me.getAttribute("name"); -- 2.39.5