Sha256: 5865c0386e03d0f71d458c710a3d83ab83db3bf792909853c7d5d738b147f6ee
Contents?: true
Size: 924 Bytes
Versions: 9
Compression:
Stored size: 924 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', 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