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

Event handlers not registering properly #210

Open
jgadbois opened this issue Jul 21, 2016 · 0 comments
Open

Event handlers not registering properly #210

jgadbois opened this issue Jul 21, 2016 · 0 comments

Comments

@jgadbois
Copy link
Contributor

I have a page with a bunch of modals on it which weren't loading content inside properly. After looking through modal.js I finally found that

# modal.js - init function
this.on('hashchange', global, modal.mainHandler);
this.on('load', global, modal.mainHandler);

were not firing. I added some debug statements to the .on and it appears that the event name, element, and callback are all correct.

The strange thing is it is fixed by just doing the following:

  $(global).on('load', modal.mainHandler);
  $(global).on('hashchange', modal.mainHandler);
  //this.on('hashchange', global, modal.mainHandler);
  //this.on('load', global, modal.mainHandler);

I can't figure out for the life of me why that would matter, since this.on seems to register them the exact same way.

Possibly it has to do with having a bunch of modals on the page?

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