Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'CB-5806' of https://github.com/sgrebnov/cordova-js

  • Loading branch information...
commit a9d8c4b204d593cb2fa1149586a68715700dcd66 2 parents ba3190d + a9371e5
Jesse MacFadyen authored January 27, 2014

Showing 1 changed file with 17 additions and 10 deletions. Show diff stats Hide diff stats

  1. 27  src/windows8/exec.js
27  src/windows8/exec.js
@@ -53,18 +53,25 @@ module.exports = function (success, fail, service, action, args) {
53 53
             cordova.callbacks[callbackId] = {success: success, fail: fail};
54 54
         }
55 55
         try {
56  
-            onSuccess = function (result) {
57  
-                cordova.callbackSuccess(callbackId,
58  
-                        {
59  
-                        status: cordova.callbackStatus.OK,
60  
-                        message: result
  56
+            // callbackOptions param represents additional optional parameters command could pass back, like keepCallback or
  57
+            // custom callbackId, for example {callbackId: id, keepCallback: true, status: cordova.callbackStatus.JSON_EXCEPTION }
  58
+            // CB-5806 [Windows8] Add keepCallback support to proxy
  59
+            onSuccess = function (result, callbackOptions) {
  60
+                callbackOptions = callbackOptions || {};
  61
+                cordova.callbackSuccess(callbackOptions.callbackId || callbackId,
  62
+                    {
  63
+                        status: callbackOptions.status || cordova.callbackStatus.OK,
  64
+                        message: result,
  65
+                        keepCallback: callbackOptions.keepCallback || false
61 66
                     });
62 67
             };
63  
-            onError = function (err) {
64  
-                cordova.callbackError(callbackId,
65  
-                        {
66  
-                        status: cordova.callbackStatus.ERROR,
67  
-                        message: err
  68
+            onError = function (err, callbackOptions) {
  69
+                callbackOptions = callbackOptions || {};
  70
+                cordova.callbackError(callbackOptions.callbackId || callbackId,
  71
+                    {
  72
+                        status: callbackOptions.status || cordova.callbackStatus.ERROR,
  73
+                        message: err,
  74
+                        keepCallback: callbackOptions.keepCallback || false
68 75
                     });
69 76
             };
70 77
             proxy(onSuccess, onError, args);

0 notes on commit a9d8c4b

Please sign in to comment.
Something went wrong with that request. Please try again.