function docoTocToggle() { if ($('#doco-top-toc').is(':visible')) { $('#doco-toc-toggle').removeClass('fa-cog').addClass('fa-caret-right'); } else { $('#doco-toc-toggle').removeClass('fa-caret-right').addClass('fa-caret-down'); } $('#doco-top-toc').toggle(); return false; } toc = {}; // Generate the table of contents in the side nav menu (see view/tpl/help.tpl) $(document).ready(function () { // Generate the table of contents in the side nav menu (see view/tpl/help.tpl) $('#doco-top-toc').toc({content: "#doco-content", headings: "h3,h4,h5,h6"}); $(".doco-section").find('a').each(function () { var url = document.createElement('a'); url.href = window.location; var pageName = url.href.split('/').pop().split('#').shift().split('?').shift(); var linkName = $(this).attr('href').split('/').pop(); if (pageName === linkName) { var tocUl = $(this).closest('a').after('