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 }
|
2010-03-06 18:43:59 -05:00
|
|
|
|
|
|
|
|
# regenerate predecessors of predecessor
|
|
|
|
|
parents = @predecessor.predecessors
|
|
|
|
|
parents.each do |parent|
|
|
|
|
|
puts parent.description
|
|
|
|
|
page[parent].replace_html :partial => 'todos/todo', :locals => { :todo => parent, :parent_container_type => parent_container_type }
|
|
|
|
|
end
|
2009-11-10 22:15:16 -05:00
|
|
|
|
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)
|
2009-12-16 17:32:08 -05:00
|
|
|
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?
|
|
|
|
|
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@successor.context_id}"
|
2009-08-16 00:34:08 +02:00
|
|
|
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-29 20:00:54 -05:00
|
|
|
page << "enable_rich_interaction();"
|
2009-11-10 22:15:16 -05:00
|
|
|
else
|
|
|
|
|
page.notify :error, "There was an error removing the dependency", 8.0
|
|
|
|
|
end
|