Sha256: e52503c47c1124f4b74d20b72a41af8c95f95061065a09924813a9dbe13e59e2

Contents?: true

Size: 452 Bytes

Versions: 4

Compression:

Stored size: 452 Bytes

Contents

saveOrder = ->
  data = $("#products li").map -> 
    $(this).children().attr("value")
  .get()
  $("input[name=product_positions]").val data.join(",")
  $("#save_order").html '<button class="button btn-primary"><i class="icon-ok icon-white"></i> <%= I18n.t(:save_sorted_order) %></button>'

$("#products, #list2").dragsort
  dragSelector: "div"
  dragBetween: true
  dragEnd: saveOrder
  placeHolderTemplate: "<li class='placeHolder'><div></div></li>"

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_sort_products-2.0.0 app/assets/javascripts/admin/sort_products.js.coffee.erb
spree_sort_products-1.3.4 app/assets/javascripts/admin/sort_products.js.coffee.erb
spree_sort_products-1.3.3 app/assets/javascripts/admin/sort_products.js.coffee.erb
spree_sort_products-1.3.2 app/assets/javascripts/admin/sort_products.js.coffee.erb