Try to delay the execution of the secondconfirm
method's body by using the setTimeout
method:
function secondconfirm() {
setTimeout(function () {
alertify.confirm("Password is changed<br>Mail it to the user?", function (e) {
if (e) {
//Done
alertify.success("Password reset and mailed to user.");
} else {
// user clicked "cancel"
alertify.success("Password reset.");
}
});
}, 1000); // I went as low as 300 ms, but higher value is safer :)
return true;
}