mirror of
https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
synced 2026-04-28 00:00:04 +08:00
#59 Add specific duration of the toast
This commit is contained in:
+2
-1
@@ -16,7 +16,7 @@ Toast.prototype.optionsBuilder = function () {
|
||||
},
|
||||
|
||||
withDuration: function(d) {
|
||||
duration = d;
|
||||
duration = d.toString();
|
||||
return this;
|
||||
},
|
||||
|
||||
@@ -43,6 +43,7 @@ Toast.prototype.optionsBuilder = function () {
|
||||
|
||||
|
||||
Toast.prototype.showWithOptions = function (options, successCallback, errorCallback) {
|
||||
options.duration = (options.duration === undefined ? 'long' : options.duration.toString());
|
||||
cordova.exec(successCallback, errorCallback, "Toast", "show", [options]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user