From d3d68c2a0fa272d5a4e9ba144b4d93730a2ad691 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 9 Jun 2017 15:50:41 +0000 Subject: [PATCH] Bug 18545 [Follow-up] Remove use of onclick from OPAC Cart This patch makes a few corrections: - Use 'e.preventDefault()' instead of 'return false' in changed sections. - Modify the event handler on checkboxes to successfully handle the un-check action as well as the check action. (QA comment 5). To test, follow the original test plan. Signed-off-by: Aleisha Amohia Signed-off-by: Jesse Maseto Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart (cherry picked from commit 04a601ef659c64446790758ebbe369a2ce090875) Signed-off-by: Fridolin Somers (cherry picked from commit 970442bc39583a0491120fa60816ec4d819a7653) Signed-off-by: Katrin Fischer --- .../bootstrap/en/modules/opac-basket.tt | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index d1b137bd80..de74ce825a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -370,65 +370,64 @@ [% END # / TagsInputEnabled && loggedinusername %] $(document).ready(function(){ - $(".brief").click(function(){ + $(".brief").click(function(e){ + e.preventDefault(); showLess(); - return false; }); - $(".detail").click(function(){ + $(".detail").click(function(e){ + e.preventDefault(); showMore(); - return false; }); - $(".send").click(function(){ + $(".send").click(function(e){ + e.preventDefault(); sendBasket(); - return false; }); - $(".download").click(function(){ + $(".download").click(function(e){ + e.preventDefault(); downloadBasket(); - return false; }); - $(".print-large").click(function(){ + $(".print-large").click(function(e){ e.preventDefault(); printBasket(); - return false; }); - $(".empty").click(function(){ + $(".empty").click(function(e){ + e.preventDefault(); delBasket(); - return false; }); - $(".deleteshelf").click(function(){ + $(".deleteshelf").click(function(e){ + e.preventDefault(); delSelRecords(); - return false; }); - $(".newshelf").click(function(){ + $(".newshelf").click(function(e){ + e.preventDefault(); addSelToShelf(); - return false; }); - $(".hold").click(function(){ + $(".hold").click(function(e){ + e.preventDefault(); holdSel(); - return false; }); - $("#tagsel_tag").click(function(){ + $("#tagsel_tag").click(function(e){ + e.preventDefault(); tagSelected(); - return false; }); - $("#tagsel_button").click(function(){ + $("#tagsel_button").click(function(e){ + e.preventDefault(); tagAdded(); - return false; }); - $("#tagsel_cancel").click(function(){ + $("#tagsel_cancel").click(function(e){ + e.preventDefault(); tagCanceled(); - return false; }); $("#CheckAll").click(function(){ @@ -468,9 +467,7 @@ })); $(".cb").change(function(){ - if ($(this).prop("checked")){ - selRecord($(this).val(), true); - } + selRecord( $(this).val(), $(this).prop("checked") ); enableCheckboxActions(); return false; }); -- 2.39.5