related tags: fix initialization logic for recent/frequent/translated/artist columns.
Initialize the recent tags, frequent tags, translated tags, and artist tags columns only once, when the related tags section is first shown. The related tags section is shown automatically when the 'Edit' tab is opened, or by default on the uploads page. This fixes the /related_tags.js and /source.js calls being triggered every time the tag edit dialog box or the 'Edit' tab was opened.
This commit is contained in:
@@ -153,7 +153,6 @@ Post.open_edit_dialog = function() {
|
||||
$tag_string.css({"resize": "none", "width": "100%"});
|
||||
$tag_string.focus().selectEnd().height($tag_string[0].scrollHeight);
|
||||
|
||||
$(document).trigger("danbooru:show-post-edit-form");
|
||||
$(document).trigger("danbooru:open-post-edit-dialog");
|
||||
}
|
||||
|
||||
@@ -433,7 +432,7 @@ Post.initialize_post_sections = function() {
|
||||
$("#share").hide();
|
||||
$("#post_tag_string").focus().selectEnd().height($("#post_tag_string")[0].scrollHeight);
|
||||
$("#recommended").hide();
|
||||
$(document).trigger("danbooru:show-post-edit-form");
|
||||
$(document).trigger("danbooru:open-post-edit-tab");
|
||||
} else if (e.target.hash === "#recommended") {
|
||||
$("#comments").hide();
|
||||
$("#edit").hide();
|
||||
|
||||
Reference in New Issue
Block a user