From fa3903fe3d4955e2fd36613a7d7ac7f3a363913a 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. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Template changes only. Amended test plan: * Create a CSV profile under Tools > CSV profiles * Add CSV profile to system preference ExportWithCsvProfile 1) Check export checkbox 2) Check check in for same item 3) Switch to Renew The export checkbox should not get unchecked when switching between renew and check in. Signed-off-by: Galen Charlton --- .../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 68c4651020..cc3ae288cd 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"); }); } -- 2.39.5