#300: Home view working when completing/undoing todos

Updated toggle_check.js.rjs to handle DOM manipulation for the Home page.
This commit is contained in:
Henrik Bohre 2009-05-21 01:55:53 +02:00 committed by Eric Allen
parent 101df3fb6b
commit a02b2cc184

View file

@ -14,7 +14,7 @@ if @saved
# Activate pending todos that are successors of the completed
@pending_to_activate.each do |t|
logger.debug "#300: Removing #{t.description} from pending block and adding it to active"
page[t].remove
page[t].remove if source_view_is(:project) # Remove todo from pending block (if it exists)
page.insert_html :bottom, item_container_id(t), :partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }
end
@ -54,9 +54,10 @@ if @saved
@active_to_block.each do |t|
logger.debug "#300: Block #{t.description} that are a successor of #{@todo.description}"
page[t].remove # Remove it from active
# Insert it in deferred/pending block
logger.debug "Insert #{t.description} in deferred/pending block"
page.insert_html :bottom, item_container_id(t), :partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }
if source_view_is(:project) # Insert it in deferred/pending block if existing
logger.debug "Insert #{t.description} in deferred/pending block"
page.insert_html :bottom, item_container_id(t), :partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type }
end
end
end