Commit 661fc11c29059d8dc109ddacfb5313450bad1d12
Exists in
master
and in
27 other branches
Merge branch 'fix_focus_comment' into 'master'
Fix focus in input field when clicked on post a comment See merge request !350
Showing
3 changed files
with
3 additions
and
9 deletions
Show diff stats
plugins/require_auth_to_comment/public/hide_comment_form.js
1 | 1 | (function($) { |
2 | 2 | $(window).bind('userDataLoaded', function(event, data) { |
3 | 3 | if (data.login || $('meta[name="profile.allow_unauthenticated_comments"]').length > 0) { |
4 | - $('.post-comment-button').livequery(function() { | |
5 | - $(this).show(); | |
6 | - }); | |
7 | - $('.page-comment-form').livequery(function() { | |
8 | - $(this).show(); | |
9 | - }); | |
10 | - $('.comment-footer').livequery(function() { | |
4 | + $('.post-comment-button, .page-comment-form, .comment-footer, .display-comment-form').livequery(function() { | |
11 | 5 | $(this).show(); |
12 | 6 | }); |
13 | 7 | } | ... | ... |
plugins/require_auth_to_comment/public/style.css
public/javascripts/comment_form.js
... | ... | @@ -3,7 +3,7 @@ jQuery('.display-comment-form').click(function(){ |
3 | 3 | var $button = jQuery(this); |
4 | 4 | toggleBox($button.parents('.post_comment_box')); |
5 | 5 | jQuery($button).hide(); |
6 | - $button.closest('.page-comment-form').find('input').first().focus(); | |
6 | + $button.closest('.page-comment-form').find('input[type="text"]:visible,textarea').first().focus(); | |
7 | 7 | return false; |
8 | 8 | }); |
9 | 9 | ... | ... |