diff --git a/app/views/todos/toggle_check.js.rjs b/app/views/todos/toggle_check.js.rjs index 92289b16..68a6a89a 100644 --- a/app/views/todos/toggle_check.js.rjs +++ b/app/views/todos/toggle_check.js.rjs @@ -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