js: clean up notice/error messaging.

This commit is contained in:
evazion
2019-08-14 01:46:44 -05:00
parent e000bdb861
commit 8d07ad7390
22 changed files with 50 additions and 64 deletions

View File

@@ -1,7 +1,7 @@
<% if @error %>
$(window).trigger("danbooru:error", "<%= j @error.to_s %>");
Danbooru.error("<%= j @error.to_s %>");
<% elsif @comment_vote.errors.any? %>
$(window).trigger("danbooru:error", "<%= j @comment_vote.errors.full_messages.join('; ') %>");
Danbooru.error("<%= j @comment_vote.errors.full_messages.join('; ') %>");
<% elsif @comment_vote.is_negative? %>
$(".comment[data-comment-id=<%= @comment.id %>]").remove();
<% end %>

View File

@@ -1,5 +1,5 @@
<% if @error %>
$(window).trigger("danbooru:error", "<%= j @error.to_s %>");
Danbooru.error("<%= j @error.to_s %>");
<% else %>
$("#comment-vote-up-link-for-<%= @comment.id %>").show();
$("#comment-vote-down-link-for-<%= @comment.id %>").show();