Fix Issue #98
When elements in the table of contents are clicked in readtheorg theme, the children are toggled.
This commit is contained in:
parent
3a1995b800
commit
474852d59b
|
@ -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>");
|
||||
|
|
Loading…
Reference in New Issue