Sha256: 3e99afa3a4b2efce8f4324d1ad126bc25604639007d779facbee279d8ea611bb
Contents?: true
Size: 1.13 KB
Versions: 90
Compression:
Stored size: 1.13 KB
Contents
Spree.ready(function() { $('.js-edit-stock-item').each(function() { var $el = $(this); var model = new Spree.Models.StockItem($el.data('stock-item')); var trackInventory = $el.data('track-inventory'); var canEdit = $el.data('can-edit') new Spree.Views.Stock.EditStockItemRow({ el: $el, stockLocationName: $el.data('stock-location-name'), stockLocationId: $el.data("stock-item").stock_location_id, variantSku: $el.data("variant-sku"), model: model }); if (trackInventory === false) { $el.find('input').attr({ disabled: true, class: 'with-tip', title: '"Track inventory" option disabled for this variant' }); } if (canEdit == false) { $el.find('input').attr({ disabled: true, class: 'with-tip', title: 'You do not have permission to manage stock' }); } }); $('.js-add-stock-item').each(function() { var $el = $(this) var model = new Spree.Models.StockItem({ variant_id: $el.data('variant-id') }); new Spree.Views.Stock.AddStockItem({ el: $el, model: model }); }); });
Version data entries
90 entries across 90 versions & 1 rubygems