Files
danbooru/app/views/moderator/post/approvals/create.js.erb
evazion 847237980b Fix #3469: Rejecting post shouldn't hide pending/flagged notices
Just reload the page entirely instead of trying to update it in place.
2018-08-25 00:39:08 -05:00

12 lines
489 B
Plaintext

<% if @approval.errors.any? %>
$(window).trigger("danbooru:error", "Error: " + <%= @approval.errors.full_messages.join("; ").to_json.html_safe %>);
<% else %>
if ($("#c-posts #a-show").length) {
location.reload();
} else if ($("#c-moderator-post-queues").length) {
$("#c-moderator-post-queues #post-<%= @approval.post.id %>").hide();
$(window).trigger("danbooru:modqueue_increment_processed");
$(window).trigger("danbooru:notice", "Post was approved");
}
<% end %>