Loving using draggables/sortables in rails... two small issues though -
First bug: creating a draggable object with a handle in rails:
<%= draggable_element "item_#{item.id}",
:handle=>"myhandle" %>
this generates code like this:
<script type="text/javascript">new
Draggable(''item_7'',
{handle:myhandle})</script>
*** notice the missing quotes in the associative array around myhandle
-- simple fix to the javascript helpers for rails adding quotes ;) ***
Second bug:
having a draggable actually use the handle is borked:
new Draggable(''item_7'', {handle:"myhandle"})
this is because:
this.handle = options.handle ? $(options.handle) : this.element;
which is because sortables sends the handle not as a class name but
the actual element - perhaps it should happen from within the
draggables by changing that line to
this.handle = options.handle ?
Element.Class.childrenWith(this.element, options.handle)[0] :
this.element;
then changing the sortables to send the class name to the draggables
constructor.
------
Once those are done it works great thus far :)
Jesse Andrews