diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.rhtml index 7633bfb..d1bda7a 100644 --- a/app/views/comment/_comment_form.rhtml +++ b/app/views/comment/_comment_form.rhtml @@ -51,9 +51,7 @@ function check_captcha(button, confirm_action) { <% end %> -<% @form_div ||= 'closed' %> - -
+
<%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> <% remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> diff --git a/public/javascripts/comment_form.js b/public/javascripts/comment_form.js index d72d894..b5e0c9c 100644 --- a/public/javascripts/comment_form.js +++ b/public/javascripts/comment_form.js @@ -44,7 +44,6 @@ function save_comment(button) { this.value = ''; }); page_comment_form.find('.errorExplanation').remove(); - show_display_comment_button(); } else if(data.render_target == 'form') { //Comment with errors $.scrollTo(page_comment_form); @@ -55,7 +54,6 @@ function save_comment(button) { $('#'+ data.render_target).replaceWith(data.html); $('#' + data.render_target).effect("highlight", {}, 3000); $.colorbox.close(); - show_display_comment_button(); } else { //New comment of article comment_div.find('.article-comments-list').append(data.html); @@ -66,7 +64,6 @@ function save_comment(button) { page_comment_form.find('.errorExplanation').remove(); $.colorbox.close(); - show_display_comment_button(); } comment_div.find('.comment-count').add('#article-header .comment-count').each(function() { @@ -81,14 +78,15 @@ function save_comment(button) { if(data.msg != null) { display_notice(data.msg); } - close_loading(); toggleBox($button.closest('.post_comment_box')); + show_display_comment_button(); $button.removeClass('comment-button-loading'); $button.enable(); }, 'json'); } function show_display_comment_button() { + if(jQuery('.post_comment_box.opened').length==0) jQuery('.display-comment-form').show(); } -- libgit2 0.21.2