Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal trigger <a> with some <img> or <div> in it breaks Modal : it won't open #48

Open
LeoFlandin opened this issue Nov 4, 2014 · 0 comments

Comments

@LeoFlandin
Copy link

<a href="#" class="modal-trigger" data-options='{ "modalId": "example-modal" }'>
    <img src="http://placehold.it/50x50">
    <span>Boom !</span>
</a>

<div class="modal" id="example-modal">
    <a href="#" class="modal-close right">X</a>
    <p>This is a modal</p>
    <p>This is a modal</p>
    <p>This is a modal</p>
    <p>This is a modal</p>
</div>

Javascript error :
Uncaught TypeError: Cannot read property 'modalId' of undefined barekit.js:225

dirty fix line 225 :
$(e.target).closest('.modal-trigger').data("options").modalId
instead of
$(e.target).data("options").modalId

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant