Browse Source

trying to fix barcode scanner in sales

chemi ledon 7 years ago
parent
commit
897c7aeec4
1 changed files with 7 additions and 8 deletions
  1. 7 8
      app/views/sales/_form.html.erb

+ 7 - 8
app/views/sales/_form.html.erb

@@ -324,15 +324,14 @@
 				}
 			}
 		});
+	});
 
-		$('#typeahead').codeScanner({
-			maxEntryTime: 100, // milliseconds
-			minEntryChars: 7,  // characters
-			onScan: function ($element, code) {
-				findProductByBarcode(code);
-			}
-		});
-
+	$('#sale_form #typeahead').codeScanner({
+		maxEntryTime: 200, // milliseconds
+		minEntryChars: 7,  // characters
+		onScan: function ($element, code) {
+			findProductByBarcode(code);
+		}
 	});
 
 	$('#sale_customer_id').on('change', function() {