From 9d280fb73f646aa6f5e3ac058f1064ee75534ac8 Mon Sep 17 00:00:00 2001 From: James Glover <james.glover@sanger.ac.uk> Date: Wed, 13 Feb 2019 14:45:05 +0000 Subject: [PATCH] Allow code39 barcodes to scan --- public/javascripts/application.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 50a6fec..a82c676 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -297,12 +297,9 @@ $(document).on("keydown", ".plate-barcode", function(event) { var code=event.charCode || event.keyCode; // Check for carrage return (key code 13) - if (code==13) { - // Check that the value is 13 characters long like a barcode - if ($(event.currentTarget).val().length === 13) { - $(event.currentTarget).closest('form').find('.show-my-plates').val(false); - $(event.currentTarget).closest('.plate-search-form').submit(); - } + if (code == 13) { + $(event.currentTarget).closest('form').find('.show-my-plates').val(false); + $(event.currentTarget).closest('.plate-search-form').submit(); } });