fabien-d / alertify.js

JavaScript Alert/Notification System
http://fabien-d.github.com/alertify.js/
4.26k stars 726 forks source link

confirm not waiting for user to press ok #194

Closed MinnesotaDeveloper closed 10 years ago

MinnesotaDeveloper commented 10 years ago

function jsHandleFailedPopup(s) {if (isIOS()) {alertify.confirm('Please disable your popup blocker');go(s);} else {alert('Please disable your popup blocker for this site.');}}

I am using a select and go navigation that pop up an alertify.confirm message. The message is displaying for a very brief period of time and then redirecting to the new page. How can I prevent the subsequent javascript from firing until after the user clicks OK?

I tried the following, but the alert doesn't fire until after the sleep.

function jsHandleFailedPopup(s) {if (isIOS()) {alertify.confirm('Please disable your popup blocker');jsSleep(1000);go(s);} else {alert('Please disable your popup blocker for this site.');}}

MinnesotaDeveloper commented 10 years ago

Nevermind. I see that I need to put the function within the alertify.confirm fuction call.