test(alert): dismiss alert, then run nav.pop()

This commit is contained in:
Adam Bradley
2016-01-29 23:31:51 -06:00
parent 6a96dae283
commit ecb5e4f031
4 changed files with 57 additions and 11 deletions

View File

@@ -206,7 +206,7 @@ class ModalFirstPage {
buttons: [
{
text: 'Destructive',
style: 'destructive',
role: 'destructive',
handler: () => {
console.log('Destructive clicked');
}
@@ -217,9 +217,26 @@ class ModalFirstPage {
console.log('Archive clicked');
}
},
{
text: 'Go To Root',
handler: () => {
// overlays are added and removed from the root navigation
// find the root navigation, and pop this alert
// when the alert is done animating out, then pop off the modal
this.nav.rootNav.pop().then(() => {
this.nav.rootNav.pop();
});
// by default an alert will dismiss itself
// however, we don't want to use the default
// but rather fire off our own pop navigation
// return false so it doesn't pop automatically
return false;
}
},
{
text: 'Cancel',
style: 'cancel',
role: 'cancel',
handler: () => {
console.log('cancel this clicked');
}