aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-03-05 10:53:04 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-03-05 10:53:04 +0000
commitb1f6bb90b9e0e4fe2d153559c2fe07d16e8729fa (patch)
treec3e1ce3977f532a173733d8319aaad3be7c0fc8e /actionpack
parentbe62024c25659b47ab4edab042455022a4090f95 (diff)
downloadrails-b1f6bb90b9e0e4fe2d153559c2fe07d16e8729fa.tar.gz
rails-b1f6bb90b9e0e4fe2d153559c2fe07d16e8729fa.tar.bz2
rails-b1f6bb90b9e0e4fe2d153559c2fe07d16e8729fa.zip
Documentation for the drop_receiving_element helpers :onDrop callback. Closes #11158 [thechrisoshow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8983 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/scriptaculous_helper.rb34
1 files changed, 31 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
index 69fab27ac8..60e285b722 100644
--- a/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
+++ b/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
@@ -100,7 +100,7 @@ module ActionView
# out child elements as candidates.
#
# <tt>:scroll</tt>:: Determines whether to scroll the list during drag
- # operationsif the list runs past the visual border.
+ # operations if the list runs past the visual border.
#
# <tt>:tree</tt>:: Determines whether to treat nested lists as part of the
# main sortable list. This means that you can create multi-
@@ -117,12 +117,12 @@ module ActionView
# that has this CSS class value will be used as the handle.
#
# <tt>:ghosting</tt>:: Clones the element and drags the clone, leaving the original
- # in place until the clone is dropped (defaut is <tt>false</tt>).
+ # in place until the clone is dropped (default is <tt>false</tt>).
#
# <tt>:dropOnEmpty</tt>:: If set to true, the Sortable container will be made into
# a Droppable, that can receive a Draggable (as according to
# the containment rules) as a child element when there are no
- # more elements inside (defaut is <tt>false</tt>).
+ # more elements inside (default is <tt>false</tt>).
#
# <tt>:onChange</tt>:: Called whenever the sort order changes while dragging. When
# dragging from one Sortable to another, the callback is
@@ -180,6 +180,34 @@ module ActionView
#
# You can change the behaviour with various options, see
# http://script.aculo.us for more documentation.
+ #
+ # Some of these +options+ include:
+ # <tt>:accept</tt>:: Set this to a string or an array of strings describing the
+ # allowable CSS classes that the draggable_element must have in order
+ # to be accepted by this drop_receiving_element.
+ #
+ # <tt>:confirm</tt>:: Adds a confirmation dialog.
+ #
+ # Example:
+ # :confirm => "Are you sure you want to do this?"
+ #
+ # <tt>:hoverclass</tt>:: If set, the drop_receiving_element will have this additional CSS class
+ # when an accepted draggable_element is hovered over it.
+ #
+ # <tt>:onDrop</tt>:: Called when a draggable_element is dropped onto this element.
+ # Override this callback with a javascript expression to
+ # change the default drop behavour.
+ #
+ # Example:
+ # :onDrop => "function(draggable_element, droppable_element, event) { alert('I like bananas') }"
+ #
+ # This callback gets three parameters:
+ # The +Draggable+ element, the +Droppable+ element and the
+ # +Event+ object. You can extract additional information about the
+ # drop - like if the Ctrl or Shift keys were pressed - from the +Event+ object.
+ #
+ # <tt>:with</tt>:: A JavaScript expression specifying the parameters for the XMLHttpRequest.
+ # Any expressions should return a valid URL query string.
def drop_receiving_element(element_id, options = {})
javascript_tag(drop_receiving_element_js(element_id, options).chop!)
end