2009-11-10 22:15:16 -05:00
|
|
|
if @removed
|
|
|
|
|
status_message = "Removed #{@successor.description} as dependency from #{@predecessor.description}."
|
|
|
|
|
page.notify :notice, status_message, 5.0
|
|
|
|
|
|
|
|
|
|
# replace old predecessor with one without the successor
|
|
|
|
|
page.replace dom_id(@predecessor), :partial => 'todos/todo', :locals => {
|
|
|
|
|
:todo => @predecessor, :parent_container_type => parent_container_type }
|
|
|
|
|
|
2009-08-16 00:34:08 +02:00
|
|
|
# update display if pending->active
|
2009-08-16 23:20:08 +02:00
|
|
|
if @successor.active?
|
2009-08-16 00:34:08 +02:00
|
|
|
page[@successor].remove unless source_view_is_one_of(:todo, :context)
|
|
|
|
|
page.insert_html :bottom, item_container_id(@successor), :partial => 'todos/todo', :locals => {
|
|
|
|
|
:todo => @successor, :parent_container_type => parent_container_type }
|
|
|
|
|
page.visual_effect :highlight, dom_id(@successor, 'line'), {'startcolor' => "'#99ff99'"}
|
|
|
|
|
end
|
2009-08-16 23:20:08 +02:00
|
|
|
|
|
|
|
|
# update display if pending->deferred
|
|
|
|
|
if @successor.deferred?
|
|
|
|
|
page.replace dom_id(@successor), :partial => 'todos/todo', :locals => {
|
|
|
|
|
:todo => @successor, :parent_container_type => parent_container_type }
|
|
|
|
|
end
|
2009-11-10 22:15:16 -05:00
|
|
|
|
2009-08-16 00:34:08 +02:00
|
|
|
page << "TodoBehavior.enableToggleNotes()"
|
2009-11-10 22:15:16 -05:00
|
|
|
page << "TodoBehavior.enableToggleSuccessors()"
|
|
|
|
|
else
|
|
|
|
|
page.notify :error, "There was an error removing the dependency", 8.0
|
|
|
|
|
end
|