From 43119d02fbbbe20c5cc1f94f8b04edb220e2ed0c Mon Sep 17 00:00:00 2001 From: Toks Date: Sun, 23 Jun 2013 11:57:34 -0400 Subject: [PATCH] fixes #1785 --- app/assets/javascripts/related_tag.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/related_tag.js b/app/assets/javascripts/related_tag.js index 69e68ad60..931dfd017 100644 --- a/app/assets/javascripts/related_tag.js +++ b/app/assets/javascripts/related_tag.js @@ -105,8 +105,14 @@ var $dest = $("#related-tags"); $dest.empty(); - $dest.append(this.build_html("recent", this.other_tags(Danbooru.Cookie.get("recent_tags_with_categories")))); - $dest.append(this.build_html("frequent", this.other_tags(Danbooru.Cookie.get("favorite_tags_with_categories")))); + var recent_tags = Danbooru.Cookie.get("recent_tags_with_categories"); + var favorite_tags = Danbooru.Cookie.get("favorite_tags_with_categories"); + if (recent_tags.length) { + $dest.append(this.build_html("recent", this.other_tags(recent_tags))); + } + if (favorite_tags.length) { + $dest.append(this.build_html("frequent", this.other_tags(favorite_tags))); + } $dest.append(this.build_html(query, related_tags)); if (wiki_page_tags.length) { $dest.append(Danbooru.RelatedTag.build_html("wiki:" + query, wiki_page_tags));