mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-01 14:58:50 +01:00
#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:
parent
101df3fb6b
commit
a02b2cc184
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue