Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #146 from mplatts/patch-1

Upgrade for Backbone 0.9.10
  • Loading branch information...
commit ccdadc2af695baf07bf9de49328933cdb3442202 2 parents 37d34ac + 9f81d81
@ryanfitz ryanfitz authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 vendor/assets/javascripts/backbone_rails_sync.js
View
12 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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.