diff --git a/InvenTree/templates/js/barcode.js b/InvenTree/templates/js/barcode.js index 990adc1a0b..8308086afb 100644 --- a/InvenTree/templates/js/barcode.js +++ b/InvenTree/templates/js/barcode.js @@ -75,7 +75,7 @@ function postBarcodeData(barcode_data, options={}) { enableBarcodeInput(modal, true); if (status == 'success') { - + if ('success' in response) { if (options.onScan) { options.onScan(response); @@ -125,7 +125,7 @@ function enableBarcodeInput(modal, enabled=true) { var barcode = $(modal + ' #barcode'); barcode.prop('disabled', !enabled); - + modalEnable(modal, enabled); barcode.focus(); @@ -157,14 +157,14 @@ function barcodeDialog(title, options={}) { var barcode = getBarcodeData(modal); if (barcode && barcode.length > 0) { - + postBarcodeData(barcode, options); } } $(modal).on('shown.bs.modal', function() { $(modal + ' .modal-form-content').scrollTop(0); - + var barcode = $(modal + ' #barcode'); // Handle 'enter' key on barcode @@ -210,10 +210,10 @@ function barcodeDialog(title, options={}) { var content = ''; content += `