Sha256: 7538e92ee297ea558f16f7107e9336fbc097aa91aee578cf47fc463d4494dd22

Contents?: true

Size: 689 Bytes

Versions: 12

Compression:

Stored size: 689 Bytes

Contents

ready = ->
  $('tbody#sortable').sortable
    update: (event, ui) ->
      position = 1
      $(@).children('tr').each ->
        if $(@).data('id') == ui.item.data('id')
          $row = $(@)
          $.ajax(
            url: $row.data('url')
            data:
              position: position
            method: 'put',
            success: ->
              # flash the updated $row
              $row.addClass('success')
              setTimeout ( ->
                $row.removeClass('success')
              ), 500
          )
          return true
        else
          position++
  $('tbody#sortable').disableSelection


$(document).ready(ready)
$(document).on('page:load', ready)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
adminpanel-3.2.1 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-3.2.0 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-3.1.0 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-3.0.0 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.6.1 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.6.0 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.5 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.4 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.3 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.2 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.1 app/assets/javascripts/adminpanel/sortable.js.coffee
adminpanel-2.5.0 app/assets/javascripts/adminpanel/sortable.js.coffee