From 6be6ac8c4128814a9e0db7c3fe29e8b7403a9238 Mon Sep 17 00:00:00 2001 From: Toks Date: Sat, 21 Dec 2013 00:01:23 -0500 Subject: [PATCH] Fix bug when both parent and child previews are present If the current post is displayed in both the parent and child previews, there will be a duplicate dom id. This ensures the current-post class gets added to both of them. --- app/assets/javascripts/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index 60fc5f623..e9d258ba8 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -247,7 +247,7 @@ Danbooru.Post.initialize_post_relationship_previews = function() { var current_post_id = $("meta[name=post-id]").attr("content"); - $("#post_" + current_post_id).addClass("current-post"); + $("[id=post_" + current_post_id + "]").addClass("current-post"); if (Danbooru.Cookie.get("show-relationship-previews") === "0") { this.toggle_relationship_preview($("#has-children-relationship-preview"), $("#has-children-relationship-preview-link"));