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

eModal.alert doesn't show after eModal.confirm #80

Closed akiwang closed 5 years ago

akiwang commented 6 years ago
eModal.confirm(message, title).then(function() {
    eModal.close();
    DoSomethingFuction();
    // Fire an ajax request and call "eModal.alert" after request done in this function
}, function() {eModal.close();});

eModal.alert can not show and there isn't any javascript error in my console.

akiwang commented 6 years ago

I have tried out a workaround: remove the modal dialog in the callbacks of eModal.confirm. $('div[class*="modal fade"]').remove(); $('div[class*="modal-backdrop fade show"]').remove();

Then, the eModal.alert can be shown now.

eszel commented 6 years ago

With the workaround, the problem is solved! THX!

saribe commented 5 years ago

I would not suggest manipulating the dom but if you have to you can access it from the return object when executing eModal

var emodal = eMolda('messsage');

emodal.element.find(SELECTOR);

Moreover, this is an animation issue, we will try to fix ASAP; This can be worked around with:

eModal.confirm('message', 'title')
    .then(() => setTimeout(() => eModal.alert('message1', 'title1'), 666));