mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-03 15:58:50 +01:00
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:
parent
b50a1ce26f
commit
d9d08fac35
5 changed files with 29 additions and 6 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue