From 6ca27186d51e2d776024aa5447e25a552d08f30b 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 --- .../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 45932a0de6..3b7fa30a3a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -666,11 +666,7 @@ - [% IF waiting_holds_barcodes %] - - [% ELSE %] - - [% END %] +
@@ -966,31 +962,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