Skip to content

Commit

Permalink
Correct context hiding behavior in tag view
Browse files Browse the repository at this point in the history
Fixes #952
  • Loading branch information
epall committed Dec 20, 2009
1 parent 0eec884 commit 9ddd5c5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/todos/create.js.rjs
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion app/views/todos/toggle_check.js.rjs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions test/selenium/tags/complete_last_todo.rsel
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 8 additions & 0 deletions test/selenium/tags/create_todo_in_hidden_context.rsel
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 9ddd5c5

Please sign in to comment.