From 29d966cdb3178963702a87919ad3e4ae496e510c Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Tue, 1 Mar 2011 00:21:05 +0100 Subject: [PATCH] Reformat slightly; hide the table of contents if there are less than two jump marks. --- www/media/idf/js/wiki-toc.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/www/media/idf/js/wiki-toc.js b/www/media/idf/js/wiki-toc.js index 8b17b7a..940e211 100644 --- a/www/media/idf/js/wiki-toc.js +++ b/www/media/idf/js/wiki-toc.js @@ -1,7 +1,11 @@ $(document).ready(function() { - $(":header", "#wiki-content").map(function (index) { + $(":header", "#wiki-content").map(function(index) { this.id = "wikititle_" + index; - $("" + jQuery.fn.text([this]) + "").addClass("wiki-" + this.tagName.toLowerCase()).appendTo('#wiki-toc-content'); - }); + $("" + jQuery.fn.text([this]) + "") + .addClass("wiki-" + this.tagName.toLowerCase()) + .appendTo('#wiki-toc-content'); + }); + if ($('#wiki-toc-content').size() < 2) + $('#wiki-toc').hide(); });