Sha256: 7d9e64a139a8691d9030ec78ebe0fde2c0a2603d79c70c61e27755234bedb570

Contents?: true

Size: 420 Bytes

Versions: 46

Compression:

Stored size: 420 Bytes

Contents

ActionView::Helpers::JavaScriptHelper.class_eval do
  def javascript_cdata_section_with_defer content
    if defer_static_scripts?
      unless Thread.current[:deferred_static_scripts_called]  
        content = <<END
deferred_static_scripts.push(function(){
  
#{content}

});
END
      end
    end
    
    javascript_cdata_section_without_defer content
  end
  alias_method_chain :javascript_cdata_section, :defer
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
rails-ext-0.3.11 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.10 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.9 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.8 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.6 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.5 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.4 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.3 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.2 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.1 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.21 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.20 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.19 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.18 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.17 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.16 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.15 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.14 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.2.13 lib/rails_ext/hacks/defer_static_javascripts.rb