Sha256: 2c4c63a3515b92e9941537bcc48225b197c1af1bafc3b0f4e24a9c69b4247474

Contents?: true

Size: 628 Bytes

Versions: 2

Compression:

Stored size: 628 Bytes

Contents

$(function  () {
  var group = $("ol.limited_drop_targets").sortable({
    group: 'limited_drop_targets',
    isValidTarget: function  ($item, container) {
      if($item.is(".highlight"))
        return true
      else {
        return $item.parent("ol")[0] == container.el[0]
      }
    },
    onDrop: function ($item, container, _super) {
      $('#serialize_output').text(group.sortable("serialize").get().join("\n"))
      _super($item, container)
    },
    serialize: function (parent, children, isContainer) {
      return isContainer ? children.join() : parent.text()
    },
    tolerance: 6,
    distance: 10
  })
})

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
medium-editor-insert-plugin-rails-0.0.2 bower_components/jquery-sortable/source/js/examples/limited_drop_targets.js
medium-editor-insert-plugin-rails-0.0.1 bower_components/jquery-sortable/source/js/examples/limited_drop_targets.js