csquared/IMGKit

append_javascripts and append_stylesheets methods insert duplicates

Opened this issue · 0 comments

maxd commented

Steps to reproduce:

  1. Add JS or CSS file (i.e. use kit.javascripts << '...')
  2. Call to_file or to_image several times.

Added JS or CSS file will be added several times to HTML head (because to_img call append_stylesheets and append_javascripts methods every time).

So, it can cause JS errors i.e. here JS which appear then Highchart has been inserted several times:

screen shot 2016-03-03 at 3 12 22 pm