Various improvements to context drag&drop

-Don't botch other fields on context change
-Better status message
-Flash context title on drop
-Drop target close to context name
-Bolder drop target border

Closes #1033
This commit is contained in:
Eric Allen 2010-05-17 11:36:41 -04:00
parent b50a1ce26f
commit d9d08fac35
5 changed files with 29 additions and 6 deletions

View file

@ -230,6 +230,23 @@ class TodosController < ApplicationController
end
end
def change_context
@todo = Todo.find(params[:todo][:id])
@original_item_context_id = @todo.context_id
@context = Context.find(params[:todo][:context_id])
@todo.context = @context
@saved = @todo.save
@context_changed = true
@message = "Context changed to #{@context.name}"
determine_remaining_in_context_count(@original_item_context_id)
respond_to do |format|
format.js {render :action => :update }
format.xml { render :xml => @todo.to_xml( :except => :user_id ) }
end
end
def update
@source_view = params['_source_view'] || 'todo'
init_data_for_sidebar unless mobile?