Files
danbooru/app/views/sources/show.js.erb
evazion 6223f89a99 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.
2018-10-15 18:41:32 -05:00

13 lines
535 B
Plaintext

$("#source-info").replaceWith("<%= j render "info", source: @source %>");
$(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 %>);
$("#upload_artist_commentary_desc").val(<%= raw @source.dtext_artist_commentary_desc.to_json %>);
Danbooru.Upload.toggle_commentary();
}