related tags: refactor /related_tags.js to avoid updating unchanged columns.

Refactor the /related_tags.js call so that when the "Related tags"
button is clicked, it only replaces the columns that actually changed,
not the entire related tags section.

This avoids rebuilding the Recent / Frequent / Translated Tags / Artist
columns every time the "Related tags" button is clicked.
This commit is contained in:
evazion
2018-10-15 13:10:08 -05:00
parent d536f75505
commit 6223f89a99
13 changed files with 81 additions and 75 deletions

View File

@@ -1,6 +1,9 @@
$("#source-info").replaceWith("<%= j render "info", source: @source %>");
$(document).trigger("danbooru:update-source-data", <%= raw @source.to_json %>);
$(document).trigger("danbooru:update-source-data", {
source: <%= raw @source.to_json %>,
related_tags_html: "<%= j render "related_tags/source_tags", source: @source %>",
});
if ($("#c-uploads #a-new").length) {
$("#upload_artist_commentary_title").val(<%= raw @source.dtext_artist_commentary_title.to_json %>);