#300: Added infrastructure for drag and drop dependency creation

This commit is contained in:
Henrik Bohre 2009-06-10 00:07:23 +02:00 committed by Eric Allen
parent c8b442cc41
commit fe066e3bcb
4 changed files with 33 additions and 5 deletions

View file

@ -22,6 +22,7 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
<% end %>
</ul></ul>
<div class="description<%= staleness_class( todo ) %>">
<%= grip_span %>
<%= date_span -%>
<span class="todo.descr"><%= h sanitize(todo.description) %></span>
<%= successors_span %>
@ -39,3 +40,13 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'
<% end -%>
</div>
</div>
<%=
draggable_element(dom_id(todo), :revert => "'failure'", :handle => "'grip'", :onDrop => "''")
%>
<%=
drop_receiving_element(dom_id(todo),
:url => {:controller => "todos", :action => "add_predecessor"},
:with => "'successor=' + encodeURIComponent(element.id.split('_').last()) + '&predecessor=' + encodeURIComponent(#{todo.id})"
)
%>