Sha256: 02aeed90c5ac424509ffd546e260e666823f46910e710039cbb52c9d8d1b6f66
Contents?: true
Size: 446 Bytes
Versions: 10
Compression:
Stored size: 446 Bytes
Contents
class @PositionSort constructor: (element) -> @element = $(element) @setBindings() setBindings: () => @element.sortable(axis: 'y') @element.on( "sortupdate", @updatePosition) updatePosition: (event, ui) => @element.find('.js-position').each((index, el) -> $(el).val(index+1)) $.fn.positionSort = () -> @each -> new PositionSort($(this)) jQuery -> $(".js-position-sort").each () -> $(this).positionSort()
Version data entries
10 entries across 10 versions & 1 rubygems