Sha256: 81d95849d1ab37c102343b75a11206801d00a2bd5da7dd5d7b96aad7842f6f53
Contents?: true
Size: 966 Bytes
Versions: 21
Compression:
Stored size: 966 Bytes
Contents
Locomotive.Views.ContentEntries ||= {} class Locomotive.Views.ContentEntries.IndexView extends Backbone.View el: '#content' render: -> @make_sortable() return @ make_sortable: -> self = @ @$('ul#entries-list.sortable').sortable handle: 'span.handle' items: 'li.item' axis: 'y' update: (event, ui) -> self.call_sort $(@) call_sort: (folder) -> $.rails.ajax url: folder.data('url') type: 'post' dataType: 'json' data: entries: (_.map folder.sortable('toArray'), (el) -> el.replace('entry-', '')) _method: 'put' success: @.on_successful_sort error: @.on_failed_sort on_successful_sort: (data, status, xhr) -> $.growl('success', decodeURIComponent $.parseJSON xhr.getResponseHeader('X-Message')) on_failed_sort: (data, status, xhr) -> $.growl('error', decodeURIComponent $.parseJSON xhr.getResponseHeader('X-Message'))
Version data entries
21 entries across 21 versions & 1 rubygems