Sha256: db8e52cd496f1b502c863c62e005bf352035460bd8ca3d90d6b8f87e369fc64c

Contents?: true

Size: 383 Bytes

Versions: 2

Compression:

Stored size: 383 Bytes

Contents

module Nitro

# Add Scriptaculous methods to the ScriptGenerator.

module ScriptGenerator

  def visual_effect(name, id = false, options = {})
    element = id ? "'#{id}'" : "element"
    options[:queue] = "'#{options[:queue]}'" if options[:queue]
    js "new Effect.#{name.to_s.camelize}(#{element}, #{hash_to_js(options)});"
  end
  alias_method :effect, :visual_effect

end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.41.0 lib/nitro/helper/javascript/scriptaculous.rb
nitro-0.40.0 lib/nitro/helper/javascript/scriptaculous.rb