Sha256: 171f76ee94c99c572671515adef741936b8f90ddd995fee083e87a032fe46dc6
Contents?: true
Size: 986 Bytes
Versions: 21
Compression:
Stored size: 986 Bytes
Contents
Locomotive.Views.Pages ||= {} class Locomotive.Views.Pages.ListView extends Backbone.View el: '#pages-list' render: -> @make_foldable() @make_sortable() return @ make_foldable: -> @$('ul.folder .toggler').toggleMe() make_sortable: -> self = @ @$('ul.folder').sortable handle: 'em' axis: 'y' update: (event, ui) -> self.call_sort $(@) call_sort: (folder) -> $.rails.ajax url: folder.data('url') type: 'post' dataType: 'json' data: children: (_.map folder.sortable('toArray'), (el) -> el.replace('item-', '')) _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