4 ms·
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 l
by jcampbell1 12y ago
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.
- jfaat 12y agoOh 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.
- acdha 12y agoOne of the examples shows that they have a single callback function: http://tristanedwards.me/sweetalert 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/750a0fd72c3beaa6d4d71336290def4d71d3ecd2/lib/sweet-alert.js#L298 https://github.com/t4t5/sweetalert/blob/750a0fd72c3beaa6d4d7...