diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 6a2762d7..9cf5c3eb 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -64,7 +64,7 @@ module TodosHelper :complete => todo_stop_waiting_js(todo)) end end - + def todo_start_waiting_js(todo) return "$('#ul#{dom_id(todo)}').css('visibility', 'hidden'); $('##{dom_id(todo)}').block({message: null})" end diff --git a/app/models/todo.rb b/app/models/todo.rb index 55044f48..0eb9be78 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -115,6 +115,12 @@ class Todo < ActiveRecord::Base end end + def remove_predecessor(predecessor) + # remove predecessor and activate myself + predecessors.delete(predecessor) + self.activate! + end + # Returns true if t is equal to self or a successor of self def is_successor?(t) if self == t diff --git a/app/views/todos/_successor.html.erb b/app/views/todos/_successor.html.erb index 327dc81c..82d74f56 100644 --- a/app/views/todos/_successor.html.erb +++ b/app/views/todos/_successor.html.erb @@ -10,11 +10,15 @@ parameters += "&_tag_name=#{@tag_name}" if @source_view == 'tag'