Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8983

Show
Ignore:
Timestamp:
03/05/08 10:53:04 (4 months ago)
Author:
pratik
Message:

Documentation for the drop_receiving_element helpers :onDrop callback. Closes #11158 [thechrisoshow]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_view/helpers/scriptaculous_helper.rb

    r8879 r8983  
    101101      #                                   
    102102      # <tt>:scroll</tt>::               Determines whether to scroll the list during drag 
    103       #                                  operationsif the list runs past the visual border. 
     103      #                                  operations if the list runs past the visual border. 
    104104      #                                   
    105105      # <tt>:tree</tt>::                 Determines whether to treat nested lists as part of the 
     
    118118      # 
    119119      # <tt>:ghosting</tt>::             Clones the element and drags the clone, leaving the original 
    120       #                                  in place until the clone is dropped (defaut is <tt>false</tt>). 
     120      #                                  in place until the clone is dropped (default is <tt>false</tt>). 
    121121      #        
    122122      # <tt>:dropOnEmpty</tt>::          If set to true, the Sortable container will be made into 
    123123      #                                  a Droppable, that can receive a Draggable (as according to 
    124124      #                                  the containment rules) as a child element when there are no 
    125       #                                  more elements inside (defaut is <tt>false</tt>). 
     125      #                                  more elements inside (default is <tt>false</tt>). 
    126126      #        
    127127      # <tt>:onChange</tt>::             Called whenever the sort order changes while dragging. When 
     
    181181      # You can change the behaviour with various options, see 
    182182      # http://script.aculo.us for more documentation. 
     183      # 
     184      # Some of these +options+ include: 
     185      # <tt>:accept</tt>::               Set this to a string or an array of strings describing the 
     186      #                                  allowable CSS classes that the draggable_element must have in order  
     187      #                                  to be accepted by this drop_receiving_element. 
     188      # 
     189      # <tt>:confirm</tt>::              Adds a confirmation dialog. 
     190      #                                  
     191      #                                  Example: 
     192      #                                    :confirm => "Are you sure you want to do this?" 
     193      #                                  
     194      # <tt>:hoverclass</tt>::           If set, the drop_receiving_element will have this additional CSS class 
     195      #                                  when an accepted draggable_element is hovered over it.                          
     196      #                                   
     197      # <tt>:onDrop</tt>::               Called when a draggable_element is dropped onto this element.   
     198      #                                  Override this callback with a javascript expression to  
     199      #                                  change the default drop behavour. 
     200      #                                  
     201      #                                  Example: 
     202      #                                    :onDrop => "function(draggable_element, droppable_element, event) { alert('I like bananas') }" 
     203      #                           
     204      #                                  This callback gets three parameters:       
     205      #                                  The +Draggable+ element, the +Droppable+ element and the  
     206      #                                  +Event+ object.  You can extract additional information about the  
     207      #                                  drop - like if the Ctrl or Shift keys were pressed - from the +Event+ object. 
     208      # 
     209      # <tt>:with</tt>::                 A JavaScript expression specifying the parameters for the XMLHttpRequest. 
     210      #                                  Any expressions should return a valid URL query string. 
    183211      def drop_receiving_element(element_id, options = {}) 
    184212        javascript_tag(drop_receiving_element_js(element_id, options).chop!)