From 3705809ce6c829730811fc174ab73fba94d21238 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 11 Mar 2010 02:29:27 +0000 Subject: [PATCH] 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 --- javascript/core/jquery.ondemand.js | 10 +++++++++- thirdparty/prototype/prototype.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/javascript/core/jquery.ondemand.js b/javascript/core/jquery.ondemand.js index 0110e2f69..81f10d085 100644 --- a/javascript/core/jquery.ondemand.js +++ b/javascript/core/jquery.ondemand.js @@ -167,4 +167,12 @@ return _originalAjax(s); } -})(jQuery); \ No newline at end of file +})(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); +} \ No newline at end of file diff --git a/thirdparty/prototype/prototype.js b/thirdparty/prototype/prototype.js index fa2d00981..d4dee4dc8 100644 --- a/thirdparty/prototype/prototype.js +++ b/thirdparty/prototype/prototype.js @@ -853,7 +853,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), { // jquery ondemand integration patch if(typeof prototypeOnDemandHandler != 'undefined') { - prototypeOnDemandHandler(this.transport, completeHandler); + prototypeOnDemandHandler(this.transport, this.transport.status, completeHandler); } else { completeHandler(); }