This changeset adds the ability to drag and drop actions between contexts and ajaxomagically update the action's context in the backend. I've tested it in Firefox and Safari, but not on other browsers.

When you start dragging an action, the other contexts collapse to provide easier targets for dropping. After the drop, the contexts return to their previously states of collapsed/expanded.



git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@275 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-07-03 00:22:28 +00:00
parent 060f1e9a97
commit 9263249e77
6 changed files with 163 additions and 28 deletions

View file

@ -189,6 +189,23 @@ class TodoController < ApplicationController
@saved = @item.save
end
def update_context
self.init
@item = check_user_return_item
context = Context.find(params['context_id']);
if @user == context.user
@original_item_context_id = @item.context_id
@item.context_id = context.id
@item.context = context
@saved = @item.save
render :action => 'update_action'
else
render :update do |page|
page.replace_html "info", content_tag("div", "Error updating the context of the dragged item. Item and context user mis-match: #{@item.user.name} and #{@context.user.name}! - refresh the page to see them.", "class" => "warning")
end
end
end
def deferred_update_action
#self.init
@ -289,7 +306,7 @@ class TodoController < ApplicationController
end
end
end
protected
def check_user_return_item