From 8c2573a10488c25d4bbcc4e5791f74138a371b0b Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Thu, 12 Oct 2023 15:51:55 -0400 Subject: [PATCH] Bug 34668: remove binding/unbinding event for one submit event step 9) of previous patch is a bit different now, if we click outside of the modal it will proceed with the checkout instead of not doing anything --- .../prog/en/modules/circ/circulation.tt | 37 ++++++------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 4eb81beb44..d3f30e46e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -670,11 +670,7 @@ - [% IF waiting_holds_barcodes %] - - [% ELSE %] - - [% END %] +
@@ -970,31 +966,20 @@ [% FOREACH b IN waiting_holds_barcodes %] waiting_holds_barcodes.push("[% b | html %]"); [% END %] - $('#barcode').on('keyup', function() { - $('#mainform .btn-primary').off('click'); - $('#barcode').off('keypress'); + $("#mainform").on('submit', function(){ + if( $("#checkout_confirmed").length > 0 ){ + return true; + } if ( waiting_holds_barcodes.includes($('#barcode').val().trim()) ) { - $('#mainform .btn-primary').on('click',function() { - $('#mainform').submit(); - }); - - $('#barcode').on('keypress', function(e) { - if (e.which == 13) { - $('#mainform').submit(); - } - }); + return true; } else { - $('#mainform .btn-primary').on('click',function() { - $('#circ-warnwaitingholds-modal').modal(); - }); - - $('#barcode').on('keypress', function(e) { - if (e.which == 13) { - $('#circ-warnwaitingholds-modal').modal(); - } - }); + $('#circ-warnwaitingholds-modal').modal(); + return false; } }); + $("#circ-warnwaitingholds-modal").on('hidden.bs.modal',function(){ + $("#mainform").append('').submit(); + }); [% END %] $('#mainform').on('submit',function() { -- 2.34.1