haml_coffee_assets 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  # coding: UTF-8
2
2
 
3
3
  module HamlCoffeeAssets
4
- VERSION = '1.7.0' unless defined?(HamlCoffeeAssets::VERSION)
4
+ VERSION = '1.7.1' unless defined?(HamlCoffeeAssets::VERSION)
5
5
  end
@@ -78,10 +78,14 @@ var HamlCoffeeAssets = (function(){
78
78
  }
79
79
 
80
80
  if (context !== '' && context !== false) {
81
- if (placement === 'amd' && context === 'window.HAML.context') {
81
+ // With AMD we replace the context function with the one from the hamlcoffee AMD module if not set explicit
82
+ if (placement === 'amd' && context === 'window.HAML.context' && /^hamlcoffee/.test(dependencies['hc'])) {
82
83
  context = 'hc.context';
83
84
  }
84
- template = template.replace('.call(context);', '.call(' + context + '(context));');
85
+ // Only add the global template context for global placement, or when amd with the hamlcoffe module context
86
+ if (placement === 'global' || (placement === 'amd' && context == 'hc.context')) {
87
+ template = template.replace('.call(context);', '.call(' + context + '(context));');
88
+ }
85
89
  }
86
90
 
87
91
  return template;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_coffee_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  segments:
111
111
  - 0
112
- hash: 794208290192263430
112
+ hash: -4027659886031373096
113
113
  required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  none: false
115
115
  requirements: