Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As far as I can tell, there are no callbacks. With javascript's confirm, you can do:

    if(confirm(....)) { doStuff() } else { cleanup() } 
This should at least have a callbacks for the different buttons.

In terms of design, I don't like absolute vertical centering. It should be higher on the page. I use 1:2, or 1:1.6 for the top/bottom margin as my "default" modal centering.



One of the examples shows that they have a single callback function:

http://tristanedwards.me/sweetalert

Unfortunately, there's only one function so this isn't useful if you want to run code when the user cancels the dialog:

https://github.com/t4t5/sweetalert/blob/750a0fd72c3beaa6d4d7...


Oh wow, I just assumed those were tied to callbacks instead of just being a showCancelButton arg. The more I look into it the more underwhelmed I become.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: