From b9b92b626402bb1260ed84b07cb14f6cecfbdd64 Mon Sep 17 00:00:00 2001 From: albert Date: Sat, 2 Mar 2013 19:21:39 -0500 Subject: [PATCH] fixes #477 --- app/views/comment_votes/create.js.erb | 8 ++++++-- app/views/comments/partials/show/_comment.html.erb | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/comment_votes/create.js.erb b/app/views/comment_votes/create.js.erb index ee619d299..37f935818 100644 --- a/app/views/comment_votes/create.js.erb +++ b/app/views/comment_votes/create.js.erb @@ -1,5 +1,9 @@ <% if @comment_vote.errors.any? %> Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>"); -<% elsif @comment_vote.is_negative? %> - $(".comment[data-comment-id=<%= @comment.id %>]").remove(); +<% else %> + <% if @comment_vote.is_negative? %> + $(".comment[data-comment-id=<%= @comment.id %>]").remove(); + <% end %> + $("#comment-vote-up-link-for-<%= @comment.id %>").remove(); + $("#comment-vote-down-link-for-<%= @comment.id %>").remove(); <% end %> diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb index 2cf3ba51b..3e7e45e54 100644 --- a/app/views/comments/partials/show/_comment.html.erb +++ b/app/views/comments/partials/show/_comment.html.erb @@ -16,8 +16,8 @@
  • <%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete, :remote => true %>
  • <%= link_to "Edit", edit_comment_path(comment.id) %>
  • <% end %> -
  • <%= link_to "Vote up", comment_votes_path(:comment_id => comment.id, :score => "up"), :method => :post, :remote => true %>
  • -
  • <%= link_to "Vote down", comment_votes_path(:comment_id => comment.id, :score => "down"), :method => :post, :remote => true %>
  • + + <% end %>