Adding javascript to let user click table cell to check containing checkbox.
authorOwen Leonard <oleonard@myacpl.org>
Thu, 6 Nov 2008 19:04:11 +0000 (13:04 -0600)
committerChris Cormack <chris@bigballofwax.co.nz>
Fri, 4 Sep 2009 02:52:31 +0000 (14:52 +1200)
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 <td> interactions will be consistent.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl

index b233c6e..6e5f90a 100644 (file)
@@ -41,6 +41,13 @@ $.tablesorter.addParser({
             }
         } ).attr( 'checked', false );
         <!-- /TMPL_IF -->
+               $("td").click(function(e){
+                       if(e.target.tagName.toLowerCase() == 'td'){
+            $(this).find("input:checkbox").each( function() {
+                $(this).attr('checked', !$(this).attr('checked'));
+            });
+                       }
+               });
         });
 //]]>
 </script>
index ced0532..c72637d 100644 (file)
@@ -51,6 +51,18 @@ $(document).ready(function() {
         }
     } ).attr( 'checked', false );
     <!-- /TMPL_IF -->
+       $("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");