votes: fix bug with tag scripting in show score mode.
Fix a bug where scores would disappear when applying tag scripts in show scores mode.
This commit is contained in:
@@ -409,7 +409,10 @@ Post.update = async function(post_id, mode, params) {
|
|||||||
Post.pending_update_count += 1;
|
Post.pending_update_count += 1;
|
||||||
Post.show_pending_update_notice()
|
Post.show_pending_update_notice()
|
||||||
|
|
||||||
await $.ajax({ type: "PUT", url: `/posts/${post_id}.js?mode=${mode}`, data: params });
|
let urlParams = new URLSearchParams(window.location.search);
|
||||||
|
let view = urlParams.get("view");
|
||||||
|
|
||||||
|
await $.ajax({ type: "PUT", url: `/posts/${post_id}.js?mode=${mode}&view=${view}`, data: params });
|
||||||
|
|
||||||
Post.pending_update_count -= 1;
|
Post.pending_update_count -= 1;
|
||||||
Post.show_pending_update_notice();
|
Post.show_pending_update_notice();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<% if @post.valid? %>
|
<% if @post.valid? %>
|
||||||
var $post = $("#post_<%= @post.id %>");
|
var $post = $("#post_<%= @post.id %>");
|
||||||
var $new_post = $("<%= j post_preview(@post, show_deleted: true) %>");
|
var $new_post = $("<%= j post_preview(@post, show_deleted: true, show_votes: params[:view] == "score") %>");
|
||||||
Danbooru.Blacklist.apply_post($new_post.get(0));
|
Danbooru.Blacklist.apply_post($new_post.get(0));
|
||||||
$("#post_<%= @post.id %>").replaceWith($new_post);
|
$("#post_<%= @post.id %>").replaceWith($new_post);
|
||||||
<% if params[:mode] == "quick-edit" %>
|
<% if params[:mode] == "quick-edit" %>
|
||||||
|
|||||||
Reference in New Issue
Block a user