From 36e384adc7984295f9dfefe4640721b0c729c62a 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 | 8 ++++++++ .../prog/en/modules/members/moremember.tmpl | 12 ++++++++++++ 2 files changed, 20 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 d1ffe56f9e..facf757a75 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 c6f65ba0e6..53e3d584fc 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.39.5