From 9a272bd79f1ae5b0aeacbd1f3723ffd8bd0ba730 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 6 Nov 2008 13:04:11 -0600 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 | 7 +++++++ .../prog/en/modules/members/moremember.tmpl | 12 ++++++++++++ 2 files changed, 19 insertions(+) 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 b233c6e27e..6e5f90aa10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -41,6 +41,13 @@ $.tablesorter.addParser({ } } ).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')); + }); + } + }); }); //]]> 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 ced0532c4a..c72637d4b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -51,6 +51,18 @@ $(document).ready(function() { } } ).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.20.1