From c6e17602788a7ccd161eddd4ceb4d29ae346890c Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Thu, 14 Apr 2011 12:28:30 +0200 Subject: [PATCH] fix #1142 where an action unmarked as complete will not show the [C] or context name. Also fix contexts with " or ' in the name in the multi todos form --- app/helpers/todos_helper.rb | 5 ++++- app/views/todos/_new_multi_todo_form.rhtml | 8 ++++---- app/views/todos/create_multiple.js.erb | 6 +++--- app/views/todos/toggle_check.js.erb | 6 +++++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 548219f9..06c1bf5c 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -389,7 +389,10 @@ module TodosHelper (@original_item_was_deferred && @remaining_deferred_or_pending_count == 0 && (@todo.completed? || @tag_was_removed)) container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? } - page.context { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } + page.context { + container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 + container_id = "empty-d" if @completed_count && @completed_count == 0 && !@todo.completed? + } page.todo { container_id = "c#{@original_item_context_id}empty-nd" if @remaining_in_context == 0 } end return container_id.blank? ? "" : "$(\"##{container_id}\").slideDown(100);" diff --git a/app/views/todos/_new_multi_todo_form.rhtml b/app/views/todos/_new_multi_todo_form.rhtml index ecffbc0e..36f13e16 100644 --- a/app/views/todos/_new_multi_todo_form.rhtml +++ b/app/views/todos/_new_multi_todo_form.rhtml @@ -2,8 +2,8 @@