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

On Close Event is not triggering. #72

Open rkaartikeyan opened 7 years ago

rkaartikeyan commented 7 years ago

Hi,

I want to run some code on showing eModal as well as on closing(by click close button in top right or by click empty space) eModal. On showing eModal code is working, but on Close eModal code is not working. Please help me to resolve this issue.

My Code.

eModal.iframe({
    'url'       : '/validate-visitor-email.php',
    'title' : 'Validate Your Email Address',
    'size'  : 'md'
}).then(
    function(){
        console.log("Model Initiated");
    },
    function(){
        console.log("Model Closed");
    }
);
saribe commented 7 years ago

Right now, is not trigger anything for the close for iFrames/ajax. The deferred object is resolved on iFrame load.

sallyx commented 7 years ago

Hi, I can confirm this bug. Is there any workaround?

lamptech commented 6 years ago

The following worked for me on all modals generated by eModal and can be adapted easily to your requirements.

$(document).on("hide.bs.modal", ".modal", function(){ console.log('CLOSING'); });

topcss commented 5 years ago

The following worked for me on all modals generated by eModal and can be adapted easily to your requirements.

$(document).on("hide.bs.modal", ".modal", function(){ console.log('CLOSING'); });

Awesome .