From ee22382510f0a26de8946f120a962bbc17d8b4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastia=CC=81n=20Katzer?= Date: Wed, 21 Aug 2013 18:04:51 +0200 Subject: [PATCH] Support for multiple return values (Android does not support that feature out of the box) --- www/printer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/printer.js b/www/printer.js index 17838ea..81c73a1 100755 --- a/www/printer.js +++ b/www/printer.js @@ -22,7 +22,9 @@ Printer.prototype = { */ isServiceAvailable: function (callback, scope) { var callbackFn = function () { - callback.apply(scope || window, arguments); + var args = typeof arguments[0] == 'boolean' ? arguments : arguments[0]; + + callback.apply(scope || window, args); }; cordova.exec(callbackFn, null, 'Printer', 'isServiceAvailable', []); @@ -46,7 +48,9 @@ Printer.prototype = { if (typeof callback == 'function'){ callbackFn = function () { - callback.apply(scope || window, arguments); + var args = typeof arguments[0] == 'boolean' ? arguments : arguments[0]; + + callback.apply(scope || window, args); } }