From 5966959774702741ad62b8e614a7a364d6f5c49f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 13 Sep 2013 16:28:39 +0200 Subject: [PATCH] Bug 10884: circulation table: fix odd behavior on checkboxes Test plan: Play with renew, check in and export checkboxes. The expected behavior is: the renew and check in cb should work as radio button, without affecting the export cb. --- .../intranet-tmpl/prog/en/js/pages/circulation.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js index 68c4651..cc3ae28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js @@ -80,14 +80,9 @@ $(document).ready(function() { // Clicking the table cell checks the checkbox inside it $("td").on("click",function(e){ if(e.target.tagName.toLowerCase() == 'td'){ - $(this).find("input:checkbox:visible").each( function() { - if($(this).attr("checked")){ - $(this).removeAttr("checked"); - } else { - $(this).attr("checked","checked"); - radioCheckBox($(this)); - } - }); + $(this).find("input:checkbox:visible").each( function() { + $(this).click(); + }); } }); }); @@ -133,9 +128,7 @@ function validate1(date) { // prevent adjacent checkboxes from being checked simultaneously function radioCheckBox(box){ - box.parents("td").siblings().find("input:checkbox:visible").each(function(){ - if($(this).attr("checked")){ - $(this).removeAttr("checked"); - } + box.parents("td").siblings().find("input:checkbox.radio").each(function(){ + $(this).removeAttr("checked"); }); } -- 1.7.10.4