From da36c55bb2ad3bc12c1f82f9751a043666897a95 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Sun, 19 Apr 2015 20:24:05 +0200 Subject: [PATCH] Bug 14011: Triggering slip print with enter key collides with 'barcode submitted' To reproduce: - Log into staff client - Find a client with 0 checkouts - Print a slip (or cancel printing it) - Attempt to type in a barcode to checkout -- annoying modal screen pops up 'barcode submitted' message will be triggered each time you try To test: - apply patch - try to reproduce issue Signed-off-by: Mark Tompsett Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 32512b9e6a..4804c87ea4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -69,13 +69,14 @@ function toggle_onsite_checkout(){ $(document).ready(function() { $('#mainform').on('submit',function() { - $('#barcode').on('keypress',function(event) { - $('#barcodeSubmittedModal').modal(); - event.preventDefault(); } - ); + if (barcode && barcode.value) { + $('#barcode').on('keypress',function(event) { + $('#barcodeSubmittedModal').modal(); + event.preventDefault(); } + ); + } }); - [% IF !( CircAutoPrintQuickSlip == 'clear' ) %] // listen submit to trigger qslip on empty checkout $('#mainform').bind('submit',function() { -- 2.39.5