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

Bad selectors throw a fatal error #10

Closed
weotch opened this issue Jun 28, 2013 · 2 comments
Closed

Bad selectors throw a fatal error #10

weotch opened this issue Jun 28, 2013 · 2 comments

Comments

@weotch
Copy link
Member

weotch commented Jun 28, 2013

Take this example:

this.$download = $('#download');
tram(this.$download).show().set({ y: this.$download.height() * 1.5 })

If #download doesn't exist, I'm getting this JS error:

Uncaught TypeError: Cannot read property 'style' of undefined , tram.js, line 538

I personally think Tram should shrug and move on rather than throwing a fatal error.

@danro
Copy link
Collaborator

danro commented Jun 28, 2013

I remember seeing this as well. Should tram at least warn you, so you can clean up references? Or keep in line with how all the jquery methods fail silently?

@weotch
Copy link
Member Author

weotch commented Jun 28, 2013

I think just fail silently like jquery. I kind of like that you don't HAVE to put conditionals everywhere with jquery for stuff that is optional, if you KWIM.

@danro danro closed this as completed in b9dbef5 Jun 29, 2013
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

2 participants