mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Fixes #1468 -- add a 'request' event that allows folks to watch for spinners etc. Passes the XHR on which you can .then, .error, and so on.
This commit is contained in:
@@ -1475,7 +1475,9 @@
|
||||
};
|
||||
|
||||
// Make the request, allowing the user to override any Ajax options.
|
||||
return Backbone.ajax(_.extend(params, options));
|
||||
var xhr = Backbone.ajax(_.extend(params, options));
|
||||
model.trigger('request', model, xhr, options);
|
||||
return xhr;
|
||||
};
|
||||
|
||||
// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
|
||||
|
||||
Reference in New Issue
Block a user