zurb / foundation-apps

The first front-end framework created for developing fully responsive web apps.
http://foundation.zurb.com/apps
MIT License
1.58k stars 215 forks source link

Bug with zf-advise on a zf-modal #798

Open mattgrande opened 8 years ago

mattgrande commented 8 years ago

I have a modal that looks like this:

<div zf-modal="" zf-advise id="formModal" role="dialog" animation-in="slideInUp" animation-out="slideOutDown">

And I'm subscribed to it like this:

FoundationApi.subscribe( 'formModal', function( action ) {
        console.info('subscribe/formModal', action);
});

That function gets the open, close, and active-false actions. However, it does not get the active-true action.

After some playing around in the Foundation code, it seems that the active-true is trying to be published against the <aside> tag that gets generated within the zf-modal, rather than the zf-modal itself.

In my case, I've been able to subscribe to an empty string:

FoundationApi.subscribe( '', function( action ) {
        console.info('subscribe/formModal', action);
});

but I can't imagine that's desired behaviour.

soumak77 commented 8 years ago

@mattgrande I'm not sure if it would help, but I made some changes to how zf-advise works in the framework (https://github.com/zurb/foundation-apps/pull/741). I've only ever needed to use zf-advise for panels, not modals, so these changes may not fix your issue.

mattgrande commented 8 years ago

Thanks @soumak77! I'll check that out in awhile!