diff options
author | Thomas Fuchs <thomas@fesch.at> | 2006-02-27 10:37:59 +0000 |
---|---|---|
committer | Thomas Fuchs <thomas@fesch.at> | 2006-02-27 10:37:59 +0000 |
commit | d0bd952aff3f42ed95eed701916bbdf9e6f01cca (patch) | |
tree | 73ddbe0f1478ec85531c109132037c33fb24ba47 /actionpack/lib | |
parent | abe5b1573ec5c531d6b5f3d74ec97c15daa76685 (diff) | |
download | rails-d0bd952aff3f42ed95eed701916bbdf9e6f01cca.tar.gz rails-d0bd952aff3f42ed95eed701916bbdf9e6f01cca.tar.bz2 rails-d0bd952aff3f42ed95eed701916bbdf9e6f01cca.zip |
Added support for visual effects scoped queues to the visual_effect helper #3530 [Abdur-Rahman Advany]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3687 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/scriptaculous_helper.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb index 5498ae1cd9..bd88b3ec0a 100644 --- a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +++ b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb @@ -43,7 +43,12 @@ module ActionView # http://script.aculo.us for more documentation. def visual_effect(name, element_id = false, js_options = {}) element = element_id ? "'#{element_id}'" : "element" - js_options[:queue] = "'#{js_options[:queue]}'" if js_options[:queue] + + js_options[:queue] = if js_options[:queue].is_a?(Hash) + '{' + js_options[:queue].map {|k, v| k == :limit ? "#{k}:#{v}" : "#{k}:'#{v}'" }.join(',') + '}' + elsif js_options[:queue] + "'#{js_options[:queue]}'" + end if js_options[:queue] if TOGGLE_EFFECTS.include? name.to_sym "Effect.toggle(#{element},'#{name.to_s.gsub(/^toggle_/,'')}',#{options_for_javascript(js_options)});" |