Fixing Backbone.ajax implementation.

This commit is contained in:
Jeremy Ashkenas
2012-05-15 17:33:56 -04:00
parent 9f161aeb26
commit b3425b8411

View File

@@ -1369,10 +1369,9 @@
return Backbone.ajax(_.extend(params, options));
};
// Set the default ajax method if $ is defined.
if ($) Backbone.ajax = function () {
return $.ajax.apply(Backbone, arguments);
}
// If `$` is defined, set the default implementation of `Backbone.ajax` to
// proxy through.
if ($) Backbone.ajax = function(){ return $.ajax.apply($, arguments); };
// Wrap an optional error callback with a fallback error event.
Backbone.wrapError = function(onError, originalModel, options) {