
<% if @comment.errors.any? %>
    sweetAlert("Oops...", "<%= @comment.errors.full_messages.to_sentence %>", "error");
<% else %>
    $("#comment_comment").val("");
    $("#<%= dom_id(@repo) %>").find(".commentList").prepend("<%=escape_javascript(render("repos/comment", :comment => @comment))%>");
    $("#<%= dom_id(@comment) %>").effect('highlight', 500);
    $('time[data-time-ago]').timeago();
<% end %>


<% if @comment.errors.any? %>
    sweetAlert("Oops...", "<%= @comment.errors.full_messages.to_sentence %>", "error");
<% else %>
    $("#comment-input").val("");
    $("#<%= dom_id(@repo) %>").find(".commentList").prepend("<%=escape_javascript(render("repos/comment", :comment => @comment))%>");
    $("#<%= dom_id(@comment) %>").effect('highlight', 500);
    $('time[data-time-ago]').timeago();
<% end %>

Fix clearing comment form after comment sent
Fix clearing comment form after comment sent
