Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 402 Bytes
$ ->
reindexSort = (context, inputName) ->
sortInputs = $("input[name$='[#{inputName}]']", context)
sortInputs.each (index) -> $(this).val index
$("[data-sortable]").each ->
context = $(this)
inputName = $(this).attr("data-sortable")
reindexSort context, inputName
$(this).sortable
items: "fieldset"
update: (event, ui) -> reindexSort context, inputName