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 @forum_post_vote.invalid? %>
$(window).trigger("danbooru:error", <%= raw @forum_post_vote.errors.full_messages.join("; ").to_json %>);
Danbooru.error(<%= raw @forum_post_vote.errors.full_messages.join("; ").to_json %>);
<% else %>
$(window).trigger("danbooru:notice", "Voted");
var code = <%= raw render(partial: "forum_post_votes/list", locals: {forum_post: @forum_post, votes: @forum_post.votes}).to_json %>;
$("#forum-post-votes-for-<%= @forum_post.id %>").html(code);
Danbooru.notice("Voted");
var code = <%= raw render(partial: "forum_post_votes/list", locals: {forum_post: @forum_post, votes: @forum_post.votes}).to_json %>;
$("#forum-post-votes-for-<%= @forum_post.id %>").html(code);
<% end %>