saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

Popup background did not close if showing confirm and alert one by one. #13

Closed vibintv closed 8 years ago

vibintv commented 9 years ago

I have showed a confirm box using emodal. It works ok. I need to show an alert message just after the user clicks "Yes" button of confirm. I gave the alert code inside the callback function of confirm. The issue is that confirm showing but alert is not showing (but sometimes its title is showing).. Also the popup background layer is still there even i clicked outside or press escape key. I need to refresh the page.

My code snippet is

eModal.confirm({message:"Do you really want to delete this?", size:'sm',title:"Confirm",callback: function(ans){ if(ans){ eModal.alert({message:'U clicked yes',title:"Yes",size:'sm',buttons:[]}); } }});

saribe commented 9 years ago

Hi vibintv,

There is one thing that you must know about eModa!

the Emodal, only has one instance of modal!! is single!

When you are redefining a new eModal when it's is closing you can have a weird behavior!

In this case you are setting up the modal while it's closing!

You can workaround this by set a timeout to let the animation complete.

I will asap try to fix this issue and test your case and let you know.

Samuel Ribeiro Pinto

2015-07-27 10:07 GMT+01:00 vibintv notifications@github.com:

I have showed a confirm box using emodal. It works ok. I need to show an alert message just after the user clicks "Yes" button of confirm. I gave the alert code inside the callback function of confirm. The issue is that confirm showing but alert is not showing (but sometimes its title is showing).. Also the popup background layer is still there even i clicked outside or press escape key. I need to refresh the page.

My code snippet is

eModal.confirm({message:"Do you really want to delete this?", size:'sm',title:"Confirm",callback: function(ans){ if(ans){ eModal.alert({message:'U clicked yes',title:"Yes",size:'sm',buttons:[]}); } }});

— Reply to this email directly or view it on GitHub https://github.com/saribe/eModal/issues/13.