Files
danbooru/app/views/comment_votes/create.js.erb
2018-07-27 15:24:05 -07:00

12 lines
501 B
Plaintext

<% if @error %>
$(window).trigger("danbooru:error", "<%= j @error.to_s %>");
<% elsif @comment_vote.errors.any? %>
$(window).trigger("danbooru:error", "<%= j @comment_vote.errors.full_messages.join('; ') %>");
<% elsif @comment_vote.is_negative? %>
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
<% end %>
$("#comment-vote-up-link-for-<%= @comment.id %>").hide();
$("#comment-vote-down-link-for-<%= @comment.id %>").hide();
$("#comment-unvote-link-for-<%= @comment.id %>").show();