mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Trigger error on originalModel not model
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.
This commit is contained in:
@@ -1155,7 +1155,7 @@
|
||||
if (onError) {
|
||||
onError(model, resp, options);
|
||||
} else {
|
||||
model.trigger('error', model, resp, options);
|
||||
originalModel.trigger('error', model, resp, options);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user