Correct context hiding behavior in tag view

Fixes #952
This commit is contained in:
Eric Allen 2009-12-20 13:05:42 -05:00
parent 0eec884428
commit 9ddd5c5d2a
4 changed files with 17 additions and 2 deletions

View file

@ -17,7 +17,7 @@ if @saved
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}" if source_view_is_one_of(:todo, :deferred)
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@todo.context_id}" if source_view_is_one_of(:todo, :deferred, :tag)
page.insert_html :bottom, item_container_id(@todo), :partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type, :source_view => @source_view }
page.visual_effect :highlight, dom_id(@todo), :duration => 3
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?

View file

@ -20,7 +20,7 @@ if @saved
end
# remove container if empty
if @remaining_in_context == 0 && source_view_is(:todo)
if @remaining_in_context == 0 && source_view_is_one_of(:todo, :tag)
page.visual_effect :fade, "c"+@todo.context.id.to_s, :duration => 0.4
end

View file

@ -0,0 +1,7 @@
#Test for issue #952
setup :fixtures => :all
login :as => 'admin'
open "/todos/tag/foo"
click "css=#line_todo_2 .item-checkbox"
wait_for_element_not_present "css=#c2 #line_todo_2"
wait_for_not_visible "c2"

View file

@ -0,0 +1,8 @@
setup :fixtures => :all
login :as => 'admin'
open "/todos/tag/foo"
type "todo_description", "run around"
type "todo_context_name", "freetime"
click "todo_new_action_submit"
wait_for_visible "flash"
assert_text "css=#c7items div.description span", "run around"