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

Cannot .init with a target jquery element #461

Open
xori opened this issue Mar 24, 2015 · 1 comment · May be fixed by #462
Open

Cannot .init with a target jquery element #461

xori opened this issue Mar 24, 2015 · 1 comment · May be fixed by #462

Comments

@xori
Copy link

xori commented Mar 24, 2015

In the docs it says I can do

rivets.init('my-app', $('body'), {user: user})

but in reality I need to do

rivets.init('my-app', $('body')[0], {user: user})

rivets.bind still seems to work with jquery elements

http://jsfiddle.net/axz3d57L/2/ test case

@Duder-onomy
Copy link
Collaborator

You are right. This should be labeled as a bug.

The line in question is here: https://github.com/mikeric/rivets/blob/master/src/rivets.coffee#L67

I think all you would need to do is check if the element is of jQuery.

That would be a Rad little Pull Request. Maybe add a test for it? Get down with some TDD?

Here is another instance where Rivets checks for jQuery, so that you might keep the code style similar.

(gotta help out @mikeric, he got us all this far, we should help him carry the project forward)

@xori xori linked a pull request Mar 24, 2015 that will close this issue
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 a pull request may close this issue.

2 participants