Sha256: 0740aa5c768603aa7bf25bb0c5454e8d1e44f973443badba84a35f60b1355ec7

Contents?: true

Size: 555 Bytes

Versions: 21

Compression:

Stored size: 555 Bytes

Contents

(function($) {
  return $.extend($.fn, {
    backboneLink: function(model) {
      return $(this).find(":input").each(function() {
        var el, name;
        el = $(this);
        name = el.attr("name");
        model.bind("change:" + name, function() {
          return el.val(model.get(name));
        });
        return $(this).bind("change", function() {
          var attrs;
          el = $(this);
          attrs = {};
          attrs[el.attr("name")] = el.val();
          return model.set(attrs);
        });
      });
    }
  });
})(jQuery);

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
rails-backbone-0.1.2 vendor/assets/javascripts/backbone_datalink.js