Sha256: 952614fd230bd0a0c2da0a043a659d277d25f52313799df5017091d0abe80f21
Contents?: true
Size: 545 Bytes
Versions: 41
Compression:
Stored size: 545 Bytes
Contents
module Chance class Instance module JavaScript def javascript(opts) # Currently, we only include the preload JavaScript preload_javascript(opts) end # Generates the preload JavaScript def preload_javascript(opts) output = "if (typeof CHANCE_SLICES === 'undefined') var CHANCE_SLICES = [];" output += "CHANCE_SLICES = CHANCE_SLICES.concat([" output += @slices.map {|name, slice| "'" + slice[:css_name] + "'" }.join(",\n") output += "]);" end end end end
Version data entries
41 entries across 41 versions & 1 rubygems