X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..592c9401b18118e01de250d44878b9289b138f9c:/src/wolnelektury/static/js/book_text/toc.js

diff --git a/src/wolnelektury/static/js/book_text/toc.js b/src/wolnelektury/static/js/book_text/toc.js
index 31f4e9ffc..d03bbb9bd 100644
--- a/src/wolnelektury/static/js/book_text/toc.js
+++ b/src/wolnelektury/static/js/book_text/toc.js
@@ -1,9 +1,17 @@
 (function($){$(function(){
 
+    if ($("#toc a").length > 0) {
+        $("#toc > ol").appendTo($("#heretoc"));
+    }
 
-if ($('#toc li').length > 0) {
-    $('#menu-toc').show();
-}
+    if ($('#wltoc li').length > 0) {
+        $('#menu-toc').show();
+    }
 
+    if ($('#wltoc li a').length == 0) {
+        $('#menu li a[href="#wltoc"]').remove();
+    }
+
+    $("#toc").remove();
 
 })})(jQuery);