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,8 +1,8 @@
var errors = <%= @post_flag.errors.full_messages.to_json.html_safe %>;
if (errors.length > 0) {
$(window).trigger("danbooru:error", errors.join("; "));
Danbooru.error(errors.join("; "));
} else {
$(window).trigger("danbooru:notice", "Post flagged");
Danbooru.notice("Post flagged");
$("a#approve").show();
$("a#disapprove").show();
}