From 8a627d74977b7e1bb6435840a4609dbfb00395ed Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 29 Jun 2009 13:10:53 +0200 Subject: [PATCH] fix #918. Thanks Claus for finding this. regression from last commit --- app/views/todos/destroy.js.rjs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/todos/destroy.js.rjs b/app/views/todos/destroy.js.rjs index f54124ff..bb0b42ec 100644 --- a/app/views/todos/destroy.js.rjs +++ b/app/views/todos/destroy.js.rjs @@ -11,16 +11,18 @@ if @saved page['tickler-empty-nd'].show if source_view_is(:deferred) && @down_count == 0 # show new todo if the completed todo was recurring - unless @new_recurring_todo.nil? || @new_recurring_todo.deferred? - page.call "todoItems.ensureVisibleWithEffectAppear", item_container_id(@new_recurring_todo) - page.insert_html :bottom, item_container_id(@new_recurring_todo), :partial => 'todos/todo', :locals => { :todo => @new_recurring_todo, :parent_container_type => parent_container_type } - page.visual_effect :highlight, dom_id(@new_recurring_todo, 'line'), {'startcolor' => "'#99ff99'"} - page.notify :notice, "Action was deleted. Because this action is recurring, a new action was added", 6.0 - else - if @todo.recurring_todo.todos.active.count == 0 - page.notify :notice, "There is no next action after the recurring action you just deleted. The recurrence is completed", 6.0 unless @recurring_todo.nil? + if @todo.from_recurring_todo? + unless @new_recurring_todo.nil? || @new_recurring_todo.deferred? + page.call "todoItems.ensureVisibleWithEffectAppear", item_container_id(@new_recurring_todo) + page.insert_html :bottom, item_container_id(@new_recurring_todo), :partial => 'todos/todo', :locals => { :todo => @new_recurring_todo, :parent_container_type => parent_container_type } + page.visual_effect :highlight, dom_id(@new_recurring_todo, 'line'), {'startcolor' => "'#99ff99'"} + page.notify :notice, "Action was deleted. Because this action is recurring, a new action was added", 6.0 + else + if @todo.recurring_todo.todos.active.count == 0 + page.notify :notice, "There is no next action after the recurring action you just deleted. The recurrence is completed", 6.0 if @new_recurring_todo.nil? + end end end else page.notify :error, "There was an error deleting the item #{@todo.description}", 8.0 -end \ No newline at end of file +end