Skip to content

Instantly share code, notes, and snippets.

@lucassus
Created June 22, 2012 08:21
Show Gist options
  • Save lucassus/2971293 to your computer and use it in GitHub Desktop.
Save lucassus/2971293 to your computer and use it in GitHub Desktop.
index 549b6e0..55d1c5c 100644
--- a/vendor/assets/javascripts/jquery.mockjax.js
+++ b/vendor/assets/javascripts/jquery.mockjax.js
@@ -328,8 +328,8 @@
@@ -328,8 +328,8 @@
}
// Successful response
- jsonpComplete( requestSettings, mockHandler );
+
+ jsonpComplete( requestSettings, callbackContext, mockHandler );
if(jQuery.Deferred){
@@ -356,12 +356,11 @@
-
data = tmp;
- jsonpComplete( requestSettings, mockHandler );
+
+ jsonpComplete( requestSettings, requestSettings, mockHandler );
@@ -376,7 +375,7 @@
}
// The JSONP request was successful
- function jsonpSuccess(requestSettings, mockHandler) {
+ function jsonpSuccess(requestSettings,callbackContext, mockHandler) {
// If a local callback was specified, fire it and pass it the data
if ( requestSettings.success ) {
requestSettings.success.call( callbackContext, ( mockHandler.response ? mockHandler.response.t
@@ -389,7 +388,7 @@
}
// The JSONP request was completed
- function jsonpComplete(requestSettings, mockHandler) {
+ function jsonpComplete(requestSettings, callbackContext, mockHandler) {
// Process result
if ( requestSettings.complete ) {
requestSettings.complete.call( callbackContext, {} , status );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment