Sha256: 9c39e0ab3f94029d1ec455598febcc3531a8a371d28e2f7b67142e363b0bd70b

Contents?: true

Size: 1.9 KB

Versions: 1

Compression:

Stored size: 1.9 KB

Contents

{:uriI"file:///Users/madmax/Programs/itmammoth/rails_sortable/vendor/assets/javascripts/plugin.js?type=application/javascript&pipeline=self&id=8600ba6755b6a1743b5f2aa4e11a5932ab46df52fd70c0db6fff67ea3069a0da:ET:load_pathI"N/Users/madmax/Programs/itmammoth/rails_sortable/vendor/assets/javascripts;T:
filenameI"X/Users/madmax/Programs/itmammoth/rails_sortable/vendor/assets/javascripts/plugin.js;T:	nameI"plugin;T:logical_pathI"plugin.self.js;T:content_typeI"application/javascript;T:sourceI"E(function($) {

  $.fn.railsSortable = function(options) {
    options = options || {};
    var setting = $.extend({
      axis: 'y',
      scroll: 'true',
    }, options);

    setting.update = function(event, ui) {
      if (typeof options.update === 'function') {
        options.update(event, ui);
      }

      $.ajax({
        type: 'POST',
        url: '/sortable/reorder',
        dataType: 'json',
        contentType: 'application/json',
        data: JSON.stringify(makePostData($(this))),
      });
    }

    this.sortable(setting);
  };

  var makePostData = function($sortable) {
    var data = $.map($sortable.sortable('toArray'), function(sortableId) {
      klassAndId = sortableId.split(/[-=_]/);
      return { klass: klassAndId[0], id: klassAndId[1] };
    });
    return { rails_sortable: data };
  };
})(jQuery);
;T:
metadata{:dependencieso:Set:
@hash}
I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ffile-digest:///Users/madmax/Programs/itmammoth/rails_sortable/vendor/assets/javascripts/plugin.js;TTF:
requiredo;;}F:stubbedo;;}F:
linkso;;}F:charsetI"
utf-8;F:digest"%6'Gݨ>x't|4%a*+kIu):lengthiE:dependencies_digest"%	!
p$	cw&YqTY:\:idI"E8600ba6755b6a1743b5f2aa4e11a5932ab46df52fd70c0db6fff67ea3069a0da;F:
mtimel+pm[

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_sortable-1.3.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/57/57KaVAE8lSfPUt-n8Q8nIlPAFoLkOL8vkj7hGwhTsEQ.cache