Repository: cordova-plugin-dialogs Updated Branches: refs/heads/master 8f31f6f2c -> 872c4d2a0
Allow a blank string for dialog titles and messages. Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/commit/03444fcf Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/tree/03444fcf Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/diff/03444fcf Branch: refs/heads/master Commit: 03444fcfe204d0576313702b5fe5ac2c6732798d Parents: fb99451 Author: ipaterson <[email protected]> Authored: Tue Aug 4 15:33:40 2015 -0400 Committer: ipaterson <[email protected]> Committed: Tue Aug 4 15:33:40 2015 -0400 ---------------------------------------------------------------------- www/notification.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs/blob/03444fcf/www/notification.js ---------------------------------------------------------------------- diff --git a/www/notification.js b/www/notification.js index c3f70d0..44f25c1 100644 --- a/www/notification.js +++ b/www/notification.js @@ -37,7 +37,7 @@ module.exports = { * @param {String} buttonLabel Label of the close button (default: OK) */ alert: function(message, completeCallback, title, buttonLabel) { - var _title = (title || "Alert"); + var _title = (typeof title === "string" ? title : "Alert"); var _buttonLabel = (buttonLabel || "OK"); exec(completeCallback, null, "Notification", "alert", [message, _title, _buttonLabel]); }, @@ -52,7 +52,7 @@ module.exports = { * @param {Array} buttonLabels Array of the labels of the buttons (default: ['OK', 'Cancel']) */ confirm: function(message, resultCallback, title, buttonLabels) { - var _title = (title || "Confirm"); + var _title = (typeof title === "string" ? title : "Confirm"); var _buttonLabels = (buttonLabels || ["OK", "Cancel"]); // Strings are deprecated! @@ -92,8 +92,8 @@ module.exports = { * @param {String} defaultText Textbox input value (default: empty string) */ prompt: function(message, resultCallback, title, buttonLabels, defaultText) { - var _message = (message || "Prompt message"); - var _title = (title || "Prompt"); + var _message = (typeof message === "string" ? message : "Prompt message"); + var _title = (typeof title === "string" ? title : "Prompt"); var _buttonLabels = (buttonLabels || ["OK","Cancel"]); var _defaultText = (defaultText || ""); exec(resultCallback, null, "Notification", "prompt", [_message, _title, _buttonLabels, _defaultText]); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
