mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 01:30:12 +01:00
fixes #688. After update a newly created context is now shown.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@796 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
1cb7592d73
commit
38b99c71bc
2 changed files with 15 additions and 11 deletions
|
|
@ -168,6 +168,7 @@ class TodosController < ApplicationController
|
||||||
context.name = params['context_name'].strip
|
context.name = params['context_name'].strip
|
||||||
context.save
|
context.save
|
||||||
@new_context_created = true
|
@new_context_created = true
|
||||||
|
@not_done_todos = [@todo]
|
||||||
end
|
end
|
||||||
params["todo"]["context_id"] = context.id
|
params["todo"]["context_id"] = context.id
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,16 @@ if @saved
|
||||||
end
|
end
|
||||||
|
|
||||||
if source_view_is(:todo) && @todo.active?
|
if source_view_is(:todo) && @todo.active?
|
||||||
|
if @new_context_created
|
||||||
|
page.insert_html :top, 'display_box', :partial => 'contexts/context', :locals => { :context => @todo.context, :collapsible => true }
|
||||||
|
else
|
||||||
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@todo.context_id}"
|
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@todo.context_id}"
|
||||||
page.call "todoItems.expandNextActionListingByContext", "c#{@todo.context_id}items", true
|
page.call "todoItems.expandNextActionListingByContext", "c#{@todo.context_id}items", true
|
||||||
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?
|
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?
|
||||||
# show all todos in context
|
# show all todos in context
|
||||||
page.insert_html :bottom, "c#{@todo.context_id}items", :partial => 'todos/todo', :locals => { :parent_container_type => parent_container_type }
|
page.insert_html :bottom, "c#{@todo.context_id}items", :partial => 'todos/todo', :locals => { :parent_container_type => parent_container_type }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
# update badge count
|
# update badge count
|
||||||
page.replace_html("badge_count", @remaining_in_context) if source_view_is :context
|
page.replace_html("badge_count", @remaining_in_context) if source_view_is :context
|
||||||
page.replace_html("badge_count", @down_count) if source_view_is :todo
|
page.replace_html("badge_count", @down_count) if source_view_is :todo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue