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

Context bugfix #76

Merged
merged 2 commits into from
Nov 7, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ statement. But when you're using Haml Coffee Assets, then you can have the scope
with the context by enable it in the configuration:

```ruby
config.hamlcoffee.extendContext = true
config.hamlcoffee.extendScope = true
```

With this option enabled, you don't need to use `@` or `this` to reference context data:
Expand Down
2 changes: 1 addition & 1 deletion lib/js/haml_coffee_assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ var HamlCoffeeAssets = (function(){
var hamlc = CoffeeScript.compile(compiler.precompile(), { bare: true });

if (extendScope) {
template = '(function(context) {\n with(context || {}) {\n return (function() {\n' + hamlc.replace(/^(.*)$/mg, ' $1') + '\n };\n }).call(context);\n});';
template = '(function(context) {\n with(context || {}) {\n return (function() {\n' + hamlc.replace(/^(.*)$/mg, ' $1') + '\n }).call(context);\n };\n});';
} else {
template = '(function(context) {\n return (function() {\n' + hamlc.replace(/^(.*)$/mg, ' $1') + '\n }).call(context);\n});';
}
Expand Down