From 74fcaf407ca89435551754d0d1668c4ae54a7d0e Mon Sep 17 00:00:00 2001 From: Eric Allen Date: Wed, 4 Nov 2009 22:37:33 -0500 Subject: [PATCH] Bug #300: check_toggle.js working for Tag view Conflicts: app/helpers/todos_helper.rb --- app/helpers/todos_helper.rb | 7 ++++--- app/views/todos/toggle_check.js.rjs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index cfd1dbf8..fd7039d4 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -201,9 +201,10 @@ module TodosHelper end def item_container_id (todo) - if source_view_is :project - return "p#{todo.project_id}items" if todo.active? - return "tickler" if todo.deferred? or todo.pending? + if todo.deferred? or todo.pending? + return "tickler" + elsif source_view_is :project + return "p#{todo.project_id}items" end return "c#{todo.context_id}items" end diff --git a/app/views/todos/toggle_check.js.rjs b/app/views/todos/toggle_check.js.rjs index 68a6a89a..041e80c6 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 if source_view_is(:project) # Remove todo from pending block (if it exists) + page[t].remove if source_view_is(:project) or source_view_is(:tag) page.insert_html :bottom, item_container_id(t), :partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type } end @@ -54,8 +54,8 @@ 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 - if source_view_is(:project) # Insert it in deferred/pending block if existing - logger.debug "Insert #{t.description} in deferred/pending block" + if source_view_is(:project) or source_view_is(:tag) # Insert it in deferred/pending block if existing + logger.debug "Insert #{t.description} in #{item_container_id(t)} block" page.insert_html :bottom, item_container_id(t), :partial => 'todos/todo', :locals => { :todo => t, :parent_container_type => parent_container_type } end end