When elements in the table of contents are clicked in readtheorg
theme, the children are toggled.
This commit is contained in:
आयुष झा 2020-06-01 16:25:51 +05:45
parent 3a1995b800
commit 474852d59b
No known key found for this signature in database
GPG Key ID: B8A4C36CEE73C65F
1 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,23 @@
function collapse_toc_elements_on_click (nav_li_a){
/*
When an `a' element in the TOC is clicked, it's parent
`li' element's active attribute is toggled. This causes
the element to toggle between minimized and maximized
states. The active attribute is documented in bootstrap.
https://getbootstrap.com/docs/4.0/components/navbar/#nav
*/
$(nav_li_el).parent().toggleClass("active");
}
$( document ).ready(function() {
// when the document is loaded and ready, bind the
// function `collapse_toc_elements_on_click' to the
// `a' elements in the table of contents.
$("#text-table-of-contents a").click(function() {
collapse_toc_elements_on_click(this);
});
});
$(function() {
$('.note').before("<p class='admonition-title note'>Note</p>");
$('.seealso').before("<p class='admonition-title seealso'>See also</p>");