Sha256: c015f5c790efd1ae4beaa698e120a97353f5daac200f16dc4bb0477efe0be8e5

Contents?: true

Size: 1.81 KB

Versions: 4

Compression:

Stored size: 1.81 KB

Contents

{:uriI"file:///Users/madmax/Programs/itmammoth/rails_sortable/vendor/assets/javascripts/plugin.js?type=application/javascript&pipeline=self&id=f3d0797b8d3b4d046fac67277970fe66edb5c5bfb41bd7f2fa0195503135382b: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"(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);
      }
      console.log(makePostData($(this)));
      // $.post("/sortable/reorder", makePostData($(this)));
    }

    this.sortable(setting);
  };

  var makePostData = function($sortable) {
    var data = {}, klass, id;
    $sortable.sortable('toArray').forEach(function(sortableId) {
      [klass, id] = sortableId.split(/[-=_]/);
      (data[klass] || (data[klass] = [])).push(id);
    });
    return { railsSortable: 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"%FVwX:h,#Toy0:lengthi:dependencies_digest"%q
͑]ZByE_օ?-:idI"Ef3d0797b8d3b4d046fac67277970fe66edb5c5bfb41bd7f2fa0195503135382b;F:
mtimel+Z

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_sortable-1.3.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/01/01R-s_WCfie5NOUCgzCRAa1HGSgrRGzSWOC_m6QKtDs.cache
rails_sortable-1.2.1 spec/dummy/tmp/cache/assets/sprockets/v3.0/01/01R-s_WCfie5NOUCgzCRAa1HGSgrRGzSWOC_m6QKtDs.cache
rails_sortable-1.2.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/01/01R-s_WCfie5NOUCgzCRAa1HGSgrRGzSWOC_m6QKtDs.cache
rails_sortable-1.1.4 spec/dummy/tmp/cache/assets/sprockets/v3.0/01/01R-s_WCfie5NOUCgzCRAa1HGSgrRGzSWOC_m6QKtDs.cache