BUGFIX Fixed jQuery.ondemand.js script to work with prototype.js (will probably need to be merged back to trunk for legacy purposes)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100853 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-03-11 02:29:27 +00:00 committed by Sam Minnee
parent 7dc9e50cbd
commit 3705809ce6
2 changed files with 10 additions and 2 deletions

View File

@ -167,4 +167,12 @@
return _originalAjax(s); return _originalAjax(s);
} }
})(jQuery); })(jQuery);
/**
* This is the on-demand handler used by our patched version of prototype.
* once we get rid of all uses of prototype, we can remove this
*/
function prototypeOnDemandHandler(xml, status, callback) {
jQuery.processOnDemandHeaders(xml, status, callback);
}

View File

@ -853,7 +853,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
// jquery ondemand integration patch // jquery ondemand integration patch
if(typeof prototypeOnDemandHandler != 'undefined') { if(typeof prototypeOnDemandHandler != 'undefined') {
prototypeOnDemandHandler(this.transport, completeHandler); prototypeOnDemandHandler(this.transport, this.transport.status, completeHandler);
} else { } else {
completeHandler(); completeHandler();
} }