Permalink
Browse files

Merge pull request #146 from mplatts/patch-1

Upgrade for Backbone 0.9.10
  • Loading branch information...
Ryan Fitzgerald
Ryan Fitzgerald committed Feb 2, 2013
2 parents 37d34ac + 9f81d81 commit ccdadc2af695baf07bf9de49328933cdb3442202
Showing with 12 additions and 0 deletions.
  1. +12 −0 vendor/assets/javascripts/backbone_rails_sync.js
@@ -62,6 +62,18 @@
if (complete) complete(jqXHR, textStatus);
};
+ var success = options.success;
+ params.success = function(resp) {
+ if (success) success(model, resp, options);
+ model.trigger('sync', model, resp, options);
+ };
+
+ var error = options.error;
+ params.error = function(xhr) {
+ if (error) error(model, xhr, options);
+ model.trigger('error', model, xhr, options);
+ };
+
// Make the request.
return $.ajax(params);
}

0 comments on commit ccdadc2

Please sign in to comment.