From 8b5dd5eb0139fdff35595f7e26f214659bde1fa6 Mon Sep 17 00:00:00 2001 From: VincentRoth Date: Wed, 29 Jun 2016 18:01:42 +0200 Subject: [PATCH] Generalize callback context to options object and prepare for bounds parameter --- www/plugins.FileOpener2.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/www/plugins.FileOpener2.js b/www/plugins.FileOpener2.js index 06519dd..25047b5 100644 --- a/www/plugins.FileOpener2.js +++ b/www/plugins.FileOpener2.js @@ -26,19 +26,19 @@ var exec = require('cordova/exec'); function FileOpener2() {} -FileOpener2.prototype.open = function (fileName, contentType, callbackContext) { - callbackContext = callbackContext || {}; - exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]); +FileOpener2.prototype.open = function (fileName, contentType, options) { + options = options || {}; + exec(options.success || null, options.error || null, 'FileOpener2', 'open', [fileName, contentType, options.bounds]); }; -FileOpener2.prototype.uninstall = function (packageId, callbackContext) { - callbackContext = callbackContext || {}; - exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]); +FileOpener2.prototype.uninstall = function (packageId, options) { + options = options || {}; + exec(options.success || null, options.error || null, 'FileOpener2', 'uninstall', [packageId]); }; -FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) { - callbackContext = callbackContext || {}; - exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]); +FileOpener2.prototype.appIsInstalled = function (packageId, options) { + options = options || {}; + exec(options.success || null, options.error || null, 'FileOpener2', 'appIsInstalled', [packageId]); }; -module.exports = new FileOpener2(); \ No newline at end of file +module.exports = new FileOpener2();