Support for multiple return values (Android does not support that feature out of the box)
This commit is contained in:
parent
86daaca96e
commit
ee22382510
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user