|
|
@@ -300,14 +300,6 @@
|
|
|
$(document).on('page:change', function() {
|
|
|
App.init();
|
|
|
$('.fileinput').fileinput();
|
|
|
- <% if @product.barcode.blank? %>
|
|
|
- $('body').barcodeListener().on('barcode.valid', function(e, code) {
|
|
|
- if($('#product_barcode').length > 0) {
|
|
|
- $('#product_barcode').val(code);
|
|
|
- validateBarcode(code);
|
|
|
- }
|
|
|
- });
|
|
|
- <% end %>
|
|
|
|
|
|
presentaciones();
|
|
|
// < % if @product.children.present? %>
|
|
|
@@ -321,16 +313,16 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- <% if @product.barcode.blank? %>
|
|
|
- // $('#product_barcode').codeScanner({ // SE ESTA TRIGGEREANDO AL ESCRIBIR TEXTO
|
|
|
- // maxEntryTime: 500, // milliseconds
|
|
|
- // minEntryChars: 5, // characters
|
|
|
- // onScan: function ($element, code) {
|
|
|
- // $('#product_barcode').val(code);
|
|
|
- // validateBarcode(code);
|
|
|
- // }
|
|
|
- // });
|
|
|
- <% end %>
|
|
|
+ <% if @product.barcode.blank? %>
|
|
|
+ $('#product_barcode').codeScanner({
|
|
|
+ maxEntryTime: 100, // milliseconds
|
|
|
+ minEntryChars: 7, // characters
|
|
|
+ onScan: function ($element, code) {
|
|
|
+ $('#product_barcode').val(code);
|
|
|
+ validateBarcode(code);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ <% end %>
|
|
|
|
|
|
$('#product_size_list').on('change', function(event) { getVariants(); });
|
|
|
$('#product_color_list').on('change', function(event) { getVariants(); });
|