From 7ed1543e0aff9f0676441de3fd4cbc8bf375bdc5 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 Signed-off-by: Mia Kujala Signed-off-by: Kelly --- .../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 dc5e6c778e..c1c15767d4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -706,11 +706,7 @@ - [% IF waiting_holds_barcodes %] - - [% ELSE %] - - [% END %] +
@@ -1007,31 +1003,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.30.2