|
@@ -32,7 +32,7 @@
|
|
|
<i class="fa fa-barcode"></i>
|
|
<i class="fa fa-barcode"></i>
|
|
|
<%= f.text_field :barcode, {:class=>"form-control input-medium", :readonly => true } %>
|
|
<%= f.text_field :barcode, {:class=>"form-control input-medium", :readonly => true } %>
|
|
|
</div>
|
|
</div>
|
|
|
- <span class="help-block">Si el codigo de barras ya existe escaneelo, si desea generarlo clickee el switch. </span>
|
|
|
|
|
|
|
+ <span class="help-block">Si el codigo de barras ya existe escaneelo, si no, se generará automaticamente. </span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group">
|
|
<div class="form-group">
|
|
@@ -300,14 +300,6 @@
|
|
|
$(document).on('page:change', function() {
|
|
$(document).on('page:change', function() {
|
|
|
App.init();
|
|
App.init();
|
|
|
$('.fileinput').fileinput();
|
|
$('.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();
|
|
presentaciones();
|
|
|
// < % if @product.children.present? %>
|
|
// < % 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_size_list').on('change', function(event) { getVariants(); });
|
|
|
$('#product_color_list').on('change', function(event) { getVariants(); });
|
|
$('#product_color_list').on('change', function(event) { getVariants(); });
|