mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
#300: Improved visual feedback when pending actions are activated
This commit is contained in:
parent
ad953fe80b
commit
496321b209
2 changed files with 9 additions and 8 deletions
|
|
@ -6,15 +6,15 @@ if @removed
|
|||
page.replace dom_id(@predecessor), :partial => 'todos/todo', :locals => {
|
||||
:todo => @predecessor, :parent_container_type => parent_container_type }
|
||||
|
||||
# if possible, remove successor from pending block
|
||||
# TODO: do not remove when multiple dependencies
|
||||
page[@successor].remove unless source_view_is :context
|
||||
# update display if pending->active
|
||||
if @successor.state == '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
|
||||
|
||||
# if possible, add successor
|
||||
container = "c#{@successor.context_id}items"
|
||||
container = "p#{@successor.project_id}items" if source_view_is :project
|
||||
page.insert_html :bottom, container, :partial => 'todos/todo', :locals => {
|
||||
:todo => @successor, :parent_container_type => parent_container_type }
|
||||
page << "TodoBehavior.enableToggleNotes()"
|
||||
page << "TodoBehavior.enableToggleSuccessors()"
|
||||
else
|
||||
page.notify :error, "There was an error removing the dependency", 8.0
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ if @saved
|
|||
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'"}
|
||||
end
|
||||
|
||||
# remove container if empty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue