Files
danbooru/app/views/posts/update.js.erb
evazion 396062869a posts: fix thumbnails on comment and modqueue pages.
Fix thumbnails being fit-to-width instead of a fixed size on the
/comments and /modqueue pages, which caused the columns to be misaligned.
2021-12-05 16:39:24 -06:00

14 lines
606 B
Plaintext

<% if @post.valid? %>
var $post = $("#post_<%= @post.id %>");
var $new_post = $("<%= j post_preview(@post, fit: :compact, show_deleted: true, show_votes: params[:view] == "score", size: params[:size]) %>");
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 %>);