X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..e15b74e6d8f736dfc8a6101e8b9c6583eebd7509:/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);