X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..1536f4b129950f206b7ffabb38805d0e1dd47661:/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);