Skip to content

Commit

Permalink
Trigger error on originalModel not model
Browse files Browse the repository at this point in the history
The original model that the 'sync' request was called in should be the
object that is taking the 'error' trigger.

After a 'fetch' request on a collection, 'model' is the jQuery xhr
object, which does not have a 'trigger' method.
  • Loading branch information
Tristan McCann committed Nov 4, 2011
1 parent 7070c27 commit da51087
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@
if (onError) {
onError(model, resp, options);
} else {
model.trigger('error', model, resp, options);
originalModel.trigger('error', model, resp, options);
}
};
};
Expand Down

0 comments on commit da51087

Please sign in to comment.