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
crystal-ext-0.0.3 lib/rails_ext/hacks/defer_static_javascripts.rb
crystal-ext-0.0.2 lib/rails_ext/hacks/defer_static_javascripts.rb
crystal-ext-0.0.1 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.29 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.28 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.27 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.25 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.24 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.23 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.22 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.21 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.20 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.19 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.18 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.17 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.16 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.15 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.14 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.13 lib/rails_ext/hacks/defer_static_javascripts.rb
rails-ext-0.3.12 lib/rails_ext/hacks/defer_static_javascripts.rb