<% unless @setting.should_validate %>
  <% if comment.parent_id.nil? %>
    $('.comments').prepend("<%= j render partial: 'comments/comment', locals: { comment: comment } %>");
  <% else %>
    $("#comment-<%= comment.parent_id %>").after("<div class='nested_messages'><%= j render partial: 'comments/comment', locals: { comment: comment } %></div>");
  <% end %>
<% end %>

$('#comment_username').val('');
$('#comment_email').val('');
$('#comment_comment').val('');

NProgress.done();

<% # render 'elements/alert' %>
<% # render 'elements/scroll_to' %>
<% unless @setting.should_validate %>
  <% if comment.parent_id.nil? %>
    $('.comments').prepend("<%= j render partial: 'comments/comment', locals: { comment: comment } %>");
  <% else %>
    $("#comment-<%= comment.parent_id %>").after("<div class='nested_messages'><%= j render partial: 'comments/comment', locals: { comment: comment } %></div>");
  <% end %>
<% end %>

$('#comment_username').val('');
$('#comment_email').val('');
$('#comment_comment').val('');

NProgress.done();

Remove flash and scroll top after creating a comment
Remove flash and scroll top after creating a comment
