From 0c8544f3481f2ea9a1b421280f38c627a54f20dd 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 Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer --- .../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 4cab65fc5a..1abdb153ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -762,11 +762,7 @@ - [% IF waiting_holds_barcodes %] - - [% ELSE %] - - [% END %] +
@@ -1063,31 +1059,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.39.5