- Blacklisting individual posts was moved into its own function - Fixed Javascript variables being leaked into the user environment - Fixed post qTips being orphaned by replacements by destroying them first - Moved edit form check into post success to avoid repeating post check
17 lines
644 B
Plaintext
17 lines
644 B
Plaintext
<% if @post.valid? %>
|
|
var $post = $("#post_<%= @post.id %>");
|
|
<% if !CurrentUser.disable_post_tooltips %>
|
|
$post.find("img").qtip("destroy", true);
|
|
<% end %>
|
|
var $new_post = $("<%= j PostPresenter.preview(@post, show_deleted: true) %>");
|
|
Danbooru.Blacklist.apply_post($new_post.get(0));
|
|
$("#post_<%= @post.id %>").replaceWith($new_post);
|
|
<% if params[:mode] == "quick-edit" %>
|
|
Danbooru.PostModeMenu.close_edit_form();
|
|
<% end %>
|
|
<% else %>
|
|
Danbooru.error(`Post #<%= @post.id %>: <%= j @post.errors.full_messages.join("; ") %>`);
|
|
<% end %>
|
|
|
|
$(document).trigger("danbooru:post-preview-updated", <%= raw @post.to_json %>);
|