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

onOpen callback is called too many times #22

Closed
padupuy opened this issue Aug 9, 2016 · 2 comments
Closed

onOpen callback is called too many times #22

padupuy opened this issue Aug 9, 2016 · 2 comments
Labels

Comments

@padupuy
Copy link

padupuy commented Aug 9, 2016

Here is the code :

var modal = new tingle.modal({
      onOpen:function () {
        console.log('onOpen callback is called');
      }
    });

When you close and reopen the modal several times

modal.open();
modal.close();
modal.open();
modal.close();
modal.open();
modal.close();
modal.open();

You can see that the onOpen callback is called too many times.
capture d ecran 2016-08-09 a 12 18 15

When I look at the code (line 94)
https://github.com/robinparisi/tingle/blob/master/src/tingle.js#L94
there is an addEventListener which is attached to the modal every time the onOpen callback is called.
I think this is the origin of the issue.

@robinparisi
Copy link
Owner

Hi,

Good catch! I've just published a patch on version 0.7.3.

Thanks for the detailed issue 😄

@padupuy
Copy link
Author

padupuy commented Aug 10, 2016

Thank you @robinparisi for your quick support

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

No branches or pull requests

2 participants