wdpr
    Preparing search index...

    Module foldable-list

    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.

    Functions

    initFoldableList