Related to #1316
This commit is contained in:
Toks
2013-09-12 21:08:50 -04:00
parent 1d3a9e65f4
commit e79679ebb9
3 changed files with 67 additions and 47 deletions

View File

@@ -411,7 +411,6 @@
Danbooru.Post.initialize_post_previews = function() {
$(".post-preview").each(function(i, v) {
Danbooru.Post.initialize_title_for(v);
Danbooru.Post.initialize_preview_borders_for(v);
});
}
@@ -421,36 +420,6 @@
$img.attr("title", $post.attr("data-tags") + " user:" + $post.attr("data-uploader") + " rating:" + $post.data("rating") + " score:" + $post.data("score"));
}
Danbooru.Post.initialize_preview_borders_for = function(post) {
var $post = $(post);
var $img = $post.find("img");
var border_colors = [];
if ($post.hasClass("post-status-has-children")) {
border_colors.push("#0F0");
}
if ($post.hasClass("post-status-has-parent")) {
border_colors.push("#CC0");
}
if ($post.hasClass("post-status-deleted")) {
border_colors.push("#000");
} else if ($post.hasClass("post-status-pending")) {
border_colors.push("#00F");
} else if ($post.hasClass("post-status-flagged")) {
border_colors.push("#F00");
}
if (border_colors.length > 1) {
$img.css("border", "2px solid");
if (border_colors.length === 2) {
$img.css("border-color", border_colors[0] + " " + border_colors[1] + " " + border_colors[1] + " " + border_colors[0]);
} else if (border_colors.length === 3) {
$img.css("border-color", border_colors[0] + " " + border_colors[2] + " " + border_colors[2] + " " + border_colors[1]);
}
}
}
Danbooru.Post.initialize_post_image_resize_links = function() {
$("#image-resize-link").click(function(e) {
var $link = $(e.target);