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

Gritter not compatible with CoffeeScript? #42

Open
aarona opened this issue Mar 26, 2014 · 1 comment
Open

Gritter not compatible with CoffeeScript? #42

aarona opened this issue Mar 26, 2014 · 1 comment

Comments

@aarona
Copy link

aarona commented Mar 26, 2014

in a file (dashboard.js.coffee) I have the following line at the very top of the file:

<%= add_gritter(truncate("This is a long message that is testing the length of the truncate function.", length: 25), title: "title", after_open: "alert('Opened!');", time: 5000) %>

I get the following error:

SyntaxError: reserved word "function"

When I raise the output of add_gritter, I get the following code:

jQuery(function(){jQuery.gritter.add({time:5000,after_open:function(e){alert('Opened!');},title:'title',text:'This is a long message...'});});

As you can see, this generates javascript which causes problems when I try to parse the file with coffee first.

@aarona
Copy link
Author

aarona commented Mar 26, 2014

Suggest that add_gritter either detect if coffeescript will be rendered, or add new functions like add_gritter_coffee that generates coffeescript instead of javascript.

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