mirror of
https://gitee.com/shuto/cordova-plugin-file-opener2.git
synced 2025-01-31 12:02:49 +08:00
Setting contentType to an empty string if it is undefined
This commit is contained in:
parent
f08a0fb154
commit
7be0278c17
@ -27,11 +27,13 @@ var exec = require('cordova/exec');
|
|||||||
function FileOpener2() {}
|
function FileOpener2() {}
|
||||||
|
|
||||||
FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
|
FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
|
||||||
|
contentType = contentType || '';
|
||||||
callbackContext = callbackContext || {};
|
callbackContext = callbackContext || {};
|
||||||
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
|
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
|
||||||
};
|
};
|
||||||
|
|
||||||
FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
|
FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
|
||||||
|
contentType = contentType || '';
|
||||||
callbackContext = callbackContext || {};
|
callbackContext = callbackContext || {};
|
||||||
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false]);
|
exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false]);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user