Commit deee26e0e3830135111f3064b836f587c4588c0c
1 parent
60c6ac65
Exists in
master
and in
29 other branches
Fix: "Post a comment" button was disappearing
(ActionItem2742)
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
features/comment.feature
@@ -91,3 +91,9 @@ Feature: comment | @@ -91,3 +91,9 @@ Feature: comment | ||
91 | And I follow "Post a comment" | 91 | And I follow "Post a comment" |
92 | When I press "Post comment" | 92 | When I press "Post comment" |
93 | And I should see "2 comments" | 93 | And I should see "2 comments" |
94 | + | ||
95 | + @selenium | ||
96 | + Scenario: hide post a comment button when clicked | ||
97 | + Given I am on /booking/article-to-comment | ||
98 | + And I follow "Post a comment" | ||
99 | + Then "Post a comment" should not be visible within "#article" |
public/javascripts/comment_form.js
@@ -2,7 +2,7 @@ jQuery('.display-comment-form').unbind(); | @@ -2,7 +2,7 @@ jQuery('.display-comment-form').unbind(); | ||
2 | jQuery('.display-comment-form').click(function(){ | 2 | jQuery('.display-comment-form').click(function(){ |
3 | var $button = jQuery(this); | 3 | var $button = jQuery(this); |
4 | toggleBox($button.parents('.post_comment_box')); | 4 | toggleBox($button.parents('.post_comment_box')); |
5 | - jQuery('.display-comment-form').hide(); | 5 | + jQuery($button).hide(); |
6 | $button.closest('.page-comment-form').find('input').first().focus(); | 6 | $button.closest('.page-comment-form').find('input').first().focus(); |
7 | return false; | 7 | return false; |
8 | }); | 8 | }); |