2007-03-30 04:36:52 +00:00
if @saved
page[@todo].remove
2008-10-04 15:56:22 +02:00
page.show "empty_"+@original_item_due_id if @old_due_empty
2007-03-30 04:36:52 +00:00
page['badge_count'].replace_html @down_count
2008-07-19 20:27:45 +02:00
# remove context if empty
2009-10-30 15:20:06 -04:00
page.visual_effect(:fade, "c#{@todo.context_id}", :duration => 0.4) if (@remaining_in_context == 0)
2008-07-19 20:27:45 +02:00
# show message if there are no actions
2007-03-30 04:36:52 +00:00
page[empty_container_msg_div_id].show if !empty_container_msg_div_id.nil? && @down_count == 0
2007-11-05 05:42:43 +00:00
page['tickler-empty-nd'].show if source_view_is(:deferred) && @down_count == 0
2008-07-19 20:27:45 +02:00
# show new todo if the completed todo was recurring
2009-06-29 13:10:53 +02:00
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
2009-06-26 16:53:24 +02:00
end
2008-07-19 20:27:45 +02:00
end
2009-12-01 23:39:07 -05:00
# Activate pending todos that are successors of the deleted
@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) 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 }
page.visual_effect :highlight, dom_id(t, 'line'), {'startcolor' => "'#99ff99'", :duration => 2}
end
2007-03-30 04:36:52 +00:00
else
page.notify :error, "There was an error deleting the item #{@todo.description}", 8.0
2009-06-29 13:10:53 +02:00
end