Runtime module for foldable (collapsible) list menus.
Wikidot's foldable-list-container feature adds fold/unfold toggle
controls to nested list items. This module sets up each list item that
has a nested <ul> or <ol> with a toggle anchor and the folded
class, then attaches click handlers to toggle between folded and
unfolded states.
DOM interactions:
Queries all .foldable-list-container elements on initialization
For each <li> with nested lists, inserts a .foldable-list-toggle anchor
and adds the folded CSS class
Listens for click on each container to toggle folded/unfolded
classes on the clicked <li>
Real links (not # or javascript:;) are allowed to navigate normally
The destroy() cleanup function removes all click listeners from containers.
Runtime module for foldable (collapsible) list menus.
Wikidot's
foldable-list-containerfeature adds fold/unfold toggle controls to nested list items. This module sets up each list item that has a nested<ul>or<ol>with a toggle anchor and thefoldedclass, then attaches click handlers to toggle betweenfoldedandunfoldedstates.DOM interactions:
.foldable-list-containerelements on initialization<li>with nested lists, inserts a.foldable-list-toggleanchor and adds thefoldedCSS classclickon each container to togglefolded/unfoldedclasses on the clicked<li>#orjavascript:;) are allowed to navigate normallyThe
destroy()cleanup function removes all click listeners from containers.