Sha256: f6b01fe5ca2caaa7292162699ba724d1401b3f7b3150cd97b65e4ccd79aaaabe
Contents?: true
Size: 904 Bytes
Versions: 9
Compression:
Stored size: 904 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', xhr.getResponseHeader('X-Message')) on_failed_sort: (data, status, xhr) -> $.growl('error', xhr.getResponseHeader('X-Message'))
Version data entries
9 entries across 9 versions & 1 rubygems