Trim whitespace from beginning and end of the barcode in checkout.
authorPasi Kallinen <pasi.kallinen@pttk.fi>
Tue, 2 Jul 2013 16:36:53 +0000 (19:36 +0300)
committerBen Shum <bshum@biblio.org>
Tue, 6 Aug 2013 16:17:40 +0000 (12:17 -0400)
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/server/circ/checkout.js

index 56d5ef8..78ae98b 100644 (file)
@@ -113,7 +113,7 @@ circ.checkout.prototype = {
                         ['keypress'],
                         function(ev) {
                             if (ev.keyCode && ev.keyCode == 13) {
-                                obj.checkout( { barcode: ev.target.value } );
+                                obj.checkout( { barcode: ev.target.value.trim() } );
                             }
                         }
                     ],
@@ -143,7 +143,7 @@ circ.checkout.prototype = {
 
                             if (obj.controller.view.checkout_menu.value == 'barcode' ||
                                 obj.controller.view.checkout_menu.value === '') {
-                                params.barcode = obj.controller.view.checkout_barcode_entry_textbox.value;
+                                params.barcode = obj.controller.view.checkout_barcode_entry_textbox.value.trim();
                             } else {
                                 params.noncat = 1;
                                 params.noncat_type = obj.controller.view.checkout_menu.value;