Module: Pngfix::Helper

Defined in:
lib/pngfix/helper.rb

Instance Method Summary collapse

Instance Method Details

#pngfix_tags(*selectors) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pngfix/helper.rb', line 6

def pngfix_tags *selectors
  options = selectors.extract_options!
  options[:cc_tag] = true if options[:cc_tag].nil?
  concat("<!--[if lt IE 7]>\n".html_safe) if options[:cc_tag]
  concat javascript_include_tag("pngfix/DD_belatedPNG")
  concat "\n"
  concat (:script, :type => "text/javascript"){
    concat "\n"
    selectors.each do |selector|
      concat "DD_belatedPNG.fix('#{selector}'); ".html_safe
    end
    concat yield if block_given?
    concat "\n"
  }
  concat("\n<![endif]-->\n".html_safe) if options[:cc_tag]
end