Skip to content

Commit

Permalink
Backbone.sync success+error arguments fixed to match updated Backbone…
Browse files Browse the repository at this point in the history
….js Model.save
  • Loading branch information
Dan McGrady committed Jan 4, 2011
1 parent 07d30f6 commit de5d30a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backbone.localStorage.js
Expand Up @@ -66,7 +66,7 @@ _.extend(Store.prototype, {

// Override `Backbone.sync` to use delegate to the model or collection's
// *localStorage* property, which should be an instance of `Store`.
Backbone.sync = function(method, model, success, error) {
Backbone.sync = function(method, model, options) {

var resp;
var store = model.localStorage || model.collection.localStorage;
Expand All @@ -79,8 +79,8 @@ Backbone.sync = function(method, model, success, error) {
}

if (resp) {
success(resp);
options.success(resp);
} else {
error("Record not found");
options.error("Record not found");
}
};

0 comments on commit de5d30a

Please sign in to comment.