Bug 14011: Triggering slip print with enter key collides with 'barcode submitted'
authorMarc Véron <veron@veron.ch>
Sun, 19 Apr 2015 18:24:05 +0000 (20:24 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 4 May 2015 14:43:59 +0000 (11:43 -0300)
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 <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 32512b9..4804c87 100644 (file)
@@ -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() {