mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-28 12:58:48 +01:00
25 lines
1.1 KiB
Text
25 lines
1.1 KiB
Text
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 }
|
|
|
|
# update display if pending->active
|
|
if @successor.active?
|
|
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
|
|
|
|
# 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
|
|
page << "enable_rich_interaction();"
|
|
else
|
|
page.notify :error, "There was an error removing the dependency", 8.0
|
|
end
|