OK button moved from first to last

This commit is contained in:
Vladimir Enchev
2015-04-24 17:14:55 +03:00
parent bf8f5d8e30
commit 25e53369ee

View File

@ -62,10 +62,6 @@ function addButtonsToAlertDialog(alert: UIAlertView, options: dialogs.ConfirmOpt
return;
}
if (options.okButtonText) {
alert.addButtonWithTitle(options.okButtonText);
}
if (options.cancelButtonText) {
alert.addButtonWithTitle(options.cancelButtonText);
}
@ -73,6 +69,10 @@ function addButtonsToAlertDialog(alert: UIAlertView, options: dialogs.ConfirmOpt
if (options.neutralButtonText) {
alert.addButtonWithTitle(options.neutralButtonText);
}
if (options.okButtonText) {
alert.addButtonWithTitle(options.okButtonText);
}
}
function addButtonsToAlertController(alertController: UIAlertController, options: dialogs.ConfirmOptions,
@ -81,14 +81,6 @@ function addButtonsToAlertController(alertController: UIAlertController, options
return;
}
if (types.isString(options.okButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.UIAlertActionStyleDefault, (arg: UIAlertAction) => {
if (types.isFunction(okCallback)) {
okCallback();
}
}));
}
if (types.isString(options.cancelButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, UIAlertActionStyle.UIAlertActionStyleDefault, (arg: UIAlertAction) => {
if (types.isFunction(cancelCallback)) {
@ -104,6 +96,14 @@ function addButtonsToAlertController(alertController: UIAlertController, options
}
}));
}
if (types.isString(options.okButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.UIAlertActionStyleDefault, (arg: UIAlertAction) => {
if (types.isFunction(okCallback)) {
okCallback();
}
}));
}
}
export function alert(arg: any): Promise<void> {