Sha256: 7069724630f6c5524f4e59527f04bc6285c9e5dfbaadb4c6e672a8353566f17a

Contents?: true

Size: 799 Bytes

Versions: 6

Compression:

Stored size: 799 Bytes

Contents

$(function(){
  function updateSortable(event, ui){
    var self = $(ui.item),
          prev = $(self.prevAll('.page-part')[0]),
          id   = prev.length > 0 ? prev.data('id') : ''
      $.post(self.data('put-url'), {reposition:id, _method: 'put'})
  }
  
  $("ul.sortable").sortable({
    containment: 'parent',
    update: updateSortable
  })
  
  $(".page-part-list").sortable({
    items: '.draggable-box',
    opacity: 0.3,
    containment: 'parent',
    handle: '.drag-handler',
    update: updateSortable
  })
  
  $(".page-part-list .drag-handler").mouseenter(function(){
    $(this).parent().addClass("will-drag")
  })
  .mouseleave(function(){
    $(this).parent().removeClass("will-drag")
  })
  $(".draggable-box").mouseleave(function(){
    $(this).removeClass("will-drag")
  })
})

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuhsaft-0.2.legacy4 spec/dummy/public/javascripts/kuhsaft/cms/application.js
kuhsaft-0.2.legacy3 spec/dummy/public/javascripts/kuhsaft/cms/application.js
kuhsaft-0.2.legacy2 spec/dummy/public/javascripts/kuhsaft/cms/application.js
kuhsaft-0.2.legacy spec/dummy/public/javascripts/kuhsaft/cms/application.js
kuhsaft-0.2.1 spec/dummy/public/javascripts/kuhsaft/cms/application.js
kuhsaft-0.2 spec/dummy/public/javascripts/kuhsaft/cms/application.js