summaryrefslogtreecommitdiffstats
path: root/plugins/55/indexmenu/scripts/nojsindex.js
blob: 970f353dbeea9a21f569b4480da4da4a80ff9c06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * Javascript for index view
 *
 * @author Gerrit Uitslag <klapinklapin@gmail.com>
 */

jQuery(function () {

    jQuery('.indexmenu_nojs').each(function () {
        let $tree = jQuery(this);
        let jsajax = $tree.data('jsajax');

        $tree.dw_tree({
            toggle_selector: 'a.indexmenu_idx',
            load_data: function (show_sublist, $clicky) {

                jQuery.post(
                    DOKU_BASE + 'lib/exe/ajax.php',
                    'call=indexmenu&req=index&nojs=1&' + $clicky[0].search.substring(1) + '&max=1' + decodeURIComponent(jsajax),
                    show_sublist,
                    'html'
                );
            }
        });
    });

});