fixes #930
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
var $sidebar = $("#sidebar");
|
var $sidebar = $("#sidebar");
|
||||||
var $content = $("#content");
|
var $content = $("#content");
|
||||||
|
|
||||||
|
if (!$sidebar.length || !$content.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var sidebar_offset = $sidebar.offset().top + $sidebar.height();
|
var sidebar_offset = $sidebar.offset().top + $sidebar.height();
|
||||||
var content_offset = $content.offset().top + $content.height();
|
var content_offset = $content.offset().top + $content.height();
|
||||||
var offset = null;
|
var offset = null;
|
||||||
|
|||||||
@@ -14,12 +14,13 @@
|
|||||||
this.common_bind("#related-artists-button", "artist");
|
this.common_bind("#related-artists-button", "artist");
|
||||||
this.common_bind("#related-characters-button", "character");
|
this.common_bind("#related-characters-button", "character");
|
||||||
this.common_bind("#related-copyrights-button", "copyright");
|
this.common_bind("#related-copyrights-button", "copyright");
|
||||||
|
$("#find-artist-button").click(Danbooru.RelatedTag.find_artist);
|
||||||
if ($("#c-uploads").length) {
|
if ($("#c-uploads").length) {
|
||||||
if ($("#upload_source").val().match(/pixiv\.net/)){
|
if ($("#upload_source").val().match(/pixiv\.net/)) {
|
||||||
|
Danbooru.RelatedTag.auto_artist_find = true;
|
||||||
$("#find-artist-button").trigger("click");
|
$("#find-artist-button").trigger("click");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$("#find-artist-button").click(Danbooru.RelatedTag.find_artist);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.RelatedTag.common_bind = function(button_name, category) {
|
Danbooru.RelatedTag.common_bind = function(button_name, category) {
|
||||||
@@ -207,9 +208,10 @@
|
|||||||
}
|
}
|
||||||
var $div = $("<div/>").addClass("artist");
|
var $div = $("<div/>").addClass("artist");
|
||||||
var $ul = $("<ul/>");
|
var $ul = $("<ul/>");
|
||||||
|
var $link = null;
|
||||||
$ul.append(
|
$ul.append(
|
||||||
$("<li/>").append("Artist: ").append(
|
$("<li/>").append("Artist: ").append(
|
||||||
$("<a/>").attr("href", "/artists/" + json.id).html(json.name).click(Danbooru.RelatedTag.toggle_tag)
|
$link = $("<a/>").attr("href", "/artists/" + json.id).html(json.name).click(Danbooru.RelatedTag.toggle_tag)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (json.other_names.length > 0) {
|
if (json.other_names.length > 0) {
|
||||||
@@ -220,6 +222,7 @@
|
|||||||
});
|
});
|
||||||
$div.append($ul);
|
$div.append($ul);
|
||||||
$dest.append($div);
|
$dest.append($div);
|
||||||
|
$link.trigger("click");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
this.initialize_image();
|
this.initialize_image();
|
||||||
this.initialize_info();
|
this.initialize_info();
|
||||||
this.initialize_similar();
|
this.initialize_similar();
|
||||||
$("#related-tags-button").trigger("click");
|
if (!Danbooru.RelatedTag.auto_artist_find) {
|
||||||
|
$("#related-tags-button").trigger("click");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user