diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/scriptaculous_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/test/template/scriptaculous_helper_test.rb | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb index f79a3c50e3..033000b004 100644 --- a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +++ b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb @@ -50,6 +50,10 @@ module ActionView "'#{js_options[:queue]}'" end if js_options[:queue] + [:endcolor, :direction, :startcolor, :scaleMode, :restorecolor].each do |option| + js_options[option] = "'#{js_options[option]}'" if js_options[option] + end + if TOGGLE_EFFECTS.include? name.to_sym "Effect.toggle(#{element},'#{name.to_s.gsub(/^toggle_/,'')}',#{options_for_javascript(js_options)});" else diff --git a/actionpack/test/template/scriptaculous_helper_test.rb b/actionpack/test/template/scriptaculous_helper_test.rb index e40debc0f9..514ba9107e 100644 --- a/actionpack/test/template/scriptaculous_helper_test.rb +++ b/actionpack/test/template/scriptaculous_helper_test.rb @@ -28,6 +28,8 @@ class ScriptaculousHelperTest < Test::Unit::TestCase assert_equal "new Effect.Fade(\"fademe\",{duration:4.0});", visual_effect(:fade, "fademe", :duration => 4.0) assert_equal "new Effect.Shake(element,{});", visual_effect(:shake) assert_equal "new Effect.DropOut(\"dropme\",{queue:'end'});", visual_effect(:drop_out, 'dropme', :queue => :end) + assert_equal "new Effect.Highlight(\"status\",{endcolor:'#EEEEEE'});", visual_effect(:highlight, 'status', :endcolor => '#EEEEEE') + assert_equal "new Effect.Highlight(\"status\",{restorecolor:'#500000', startcolor:'#FEFEFE'});", visual_effect(:highlight, 'status', :restorecolor => '#500000', :startcolor => '#FEFEFE') # chop the queue params into a comma separated list beginning, ending = 'new Effect.DropOut("dropme",{queue:{', '}});' |