Sha256: 6c57e951cb9c0df438d490d0768bbd9d25764059c6bb500628bc4086ee3582ec

Contents?: true

Size: 933 Bytes

Versions: 6

Compression:

Stored size: 933 Bytes

Contents

module Facades
  module Helpers
    module Utility
      
      def facade_assets
        content = if_ie(8) do
          javascript_include_tag("https://html5shim.googlecode.com/svn/trunk/html5.js")
        end
        content.to_s.html_safe
      end
      
      ##
       # Render an IE conditional statement. By default conditionals use a less-than-or-equal-to format. Use the `specific`
       # param to force only that version.
       # 
       # @param version [Integer] The IE version to target
       # @param specific [Boolean] optional Target the IE version specificially. 
       # 
       # 
       def if_ie(version, specific = false, &block)
         content = capture(&block)
         condition = specific ? "IE #{version}" : "lte IE #{version}"
         str = "<!--[if #{condition}]>"
       	str << content.html_safe.lstrip
       	str << "<![endif]-->"
       	str.html_safe
       end
      
    end
  end  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
facades-0.1.0 lib/facades/helpers/utility.rb
facades-0.0.7 lib/facades/helpers/utility.rb
facades-0.0.6 lib/facades/helpers/utility.rb
facades-0.0.5 lib/facades/helpers/utility.rb
facades-0.0.4 lib/facades/helpers/utility.rb
facades-0.0.3 lib/facades/helpers/utility.rb