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

Add jquery.ready hook after defining plugin, to avoid breakage with modernizr/yepnope #362

Merged
merged 1 commit into from
Oct 3, 2011

Conversation

purcell
Copy link
Contributor

@purcell purcell commented Oct 3, 2011

See https://gist.github.com/1258742 for an example, which results in the error:

"TypeError: Object has no method 'dropdown' at bootstrap-dropdown.js line 31"

It looks like in these circumstances, the functions hooked into
jquery.ready get run immediately, and so applying the dropdown
behavior to specific elements before defining the 'dropdown' method
causes breakage.

-Steve

…sed with modernizr/yepnope

See https://gist.github.com/1258742 for an example, which results in the error

"TypeError: Object has no method 'dropdown' at bootstrap-dropdown.js line 31"

It looks like in these circumstances, the functions hooked into
jquery.ready get run immediately, and so applying the dropdown
behavior to specific elements before defining the 'dropdown' method
causes breakage.
fat added a commit that referenced this pull request Oct 3, 2011
Add jquery.ready hook after defining plugin, to avoid breakage with modernizr/yepnope
@fat fat merged commit b41175f into twbs:master Oct 3, 2011
@fat
Copy link
Member

fat commented Oct 3, 2011

weird, thanks!

@purcell
Copy link
Contributor Author

purcell commented Oct 3, 2011

Yeah, I understand that in some cases the DOM can end up being ready before asynchronously-loaded scripts even get executed, in which case jQuery will presumably run new ready hooks immediately. Thanks for merging!

@fat
Copy link
Member

fat commented Oct 3, 2011

yeah -- you'd think jquery would push them to the event loop even in that case, but i guess not :)

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

Successfully merging this pull request may close these issues.

2 participants