aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/prototype_helper.rb
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2006-02-26 14:20:21 +0000
committerThomas Fuchs <thomas@fesch.at>2006-02-26 14:20:21 +0000
commitd11f8d551640c94e22c221c3bee39ab572b1dc72 (patch)
tree731a29bbd880d42dc1c169779d0a7fa9a37cd93f /actionpack/lib/action_view/helpers/prototype_helper.rb
parent6a83ebfe703e922c4b0e2333521ed23208003f13 (diff)
downloadrails-d11f8d551640c94e22c221c3bee39ab572b1dc72.tar.gz
rails-d11f8d551640c94e22c221c3bee39ab572b1dc72.tar.bz2
rails-d11f8d551640c94e22c221c3bee39ab572b1dc72.zip
Added script.aculo.us drag and drop helpers to RJS [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/prototype_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 8a4498ae89..4c6c020ebe 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -565,12 +565,32 @@ module ActionView
record "}, #{(seconds * 1000).to_i})"
end
- # Starts a Scriptaculous visual effect. See
+ # Starts a script.aculo.us visual effect. See
# ActionView::Helpers::ScriptaculousHelper for more information.
def visual_effect(name, id, options = {})
record @context.send(:visual_effect, name, id, options)
end
+ # Creates a script.aculo.us sortable element. Useful
+ # to recreate sortable elements after items get added
+ # or deleted.
+ # See ActionView::Helpers::ScriptaculousHelper for more information.
+ def sortable(id, options = {})
+ record @context.send(:sortable_element_js, id, options)
+ end
+
+ # Creates a script.aculo.us draggable element.
+ # See ActionView::Helpers::ScriptaculousHelper for more information.
+ def draggable(id, options = {})
+ record @context.send(:draggable_element_js, id, options)
+ end
+
+ # Creates a script.aculo.us drop receiving element.
+ # See ActionView::Helpers::ScriptaculousHelper for more information.
+ def drop_receiving(id, options = {})
+ record @context.send(:drop_receiving_element_js, id, options)
+ end
+
private
def include_helpers_from_context
@context.extended_by.each do |mod|