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:
Tristan McCann
2011-11-04 16:02:03 -04:00
parent 7070c27d1c
commit da51087dbf

View File

@@ -1155,7 +1155,7 @@
if (onError) {
onError(model, resp, options);
} else {
model.trigger('error', model, resp, options);
originalModel.trigger('error', model, resp, options);
}
};
};