Added confirm functionality to IonPopup

This commit is contained in:
BastiRehm 2015-03-01 17:05:45 +10:00
parent 8dc91bc4a4
commit ed3d3f17bf

View file

@ -38,6 +38,25 @@ IonPopup = {
},
alert: function (options) {
IonPopup.show({
title: options.title,
subTitle: options.subtitle,
template: options.template,
templateName: options.templateName,
buttons: [
{
text: options.okText ? options.okText : 'Ok',
type: options.okType ? options.okType : 'button-positive',
onTap: function(event) {
options.onOk(event);
return true;
}
}
]
});
},
confirm: function (options) {
IonPopup.show({
title: options.title,
subTitle: options.subtitle,
@ -48,6 +67,15 @@ IonPopup = {
text: options.okText ? options.okText : 'Ok',
type: options.okType ? options.okType : 'button-positive',
onTap: function() {
if (options.onOk) options.onOk(event);
return true;
}
},
{
text: options.cancelText ? options.cancelText : 'Cancel',
type: options.cancelType ? options.cancelType : 'button-default',
onTap: function() {
if (options.onCancel) options.onCancel(event);
return true;
}
}