Skip to content

Commit

Permalink
fixes bug that hides comment form after reply
Browse files Browse the repository at this point in the history
Closes #160
  • Loading branch information
xuanxu committed Aug 13, 2015
1 parent d832d41 commit f2ea7fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/comments.js.coffee
Expand Up @@ -4,10 +4,10 @@ App.Comments =
$(response_html).insertAfter($("#js-comment-form-#{parent_id}"))

reset_and_hide_form: (id) ->
form = $("#js-comment-form-#{id} form")
input = form.find("textarea")
form_container = $("#js-comment-form-#{id}")
input = form_container.find("form textarea")
input.val('')
form.hide()
form_container.hide()

reset_form: (id) ->
input = $("#js-comment-form-#{id} form textarea")
Expand Down
2 changes: 1 addition & 1 deletion spec/features/comments_spec.rb
Expand Up @@ -70,7 +70,7 @@
expect(page).to have_content 'It will be done next week.'
end

expect(page).to have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
end

scenario "N replies", :js do
Expand Down

0 comments on commit f2ea7fd

Please sign in to comment.