Sha256: 7be87509045f1d3ebddfed822228ec8750364f66f75a8144be713030a8ec025e

Contents?: true

Size: 422 Bytes

Versions: 2

Compression:

Stored size: 422 Bytes

Contents

#= require jquery-ui/sortable

CMS.ready_with_scope 'cms-edit-mode', ->
  $('[data-cms-sortable]').each ->
    $(this).sortable
      update: (event, ui) ->
        url = $(this).data('cms-sortable')['url']

        target = $(ui.item)
        id = target.data('cms-sortable-id')
        unique_key = { position: target.index() + 1 }
        payload = $.param(id: id, unique_key: unique_key)

        $.post(url, payload)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_admin_cms-0.0.2 app/assets/javascripts/rails_admin_cms/cms/with_scope/viewables.js.coffee
rails_admin_cms-0.0.1 app/assets/javascripts/rails_admin_cms/cms/with_scope/viewables.js.coffee