summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/_themes/eldocs/static/asset/js/method-toc.js
blob: a926b3da95d3cbd8f2d2f2db4758ac403be57ac5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* modified from http://stackoverflow.com/a/12459801 */
$(function (){
    var createList = function(selector){

        var ul = $('<ul>');
        var selected = $(selector);

        if (selected.length === 0){
            return;
        }

        selected.clone().each(function (i,e){

            var p = $(e).children('.descclassname');
            var n = $(e).children('.descname');
            var l = $(e).children('.headerlink');

            var a = $('<a>');
            a.attr('href',l.attr('href')).attr('title', 'jump to ' + n + '()');

            a.append(p).append(n);

            var entry = $('<li>').append(a);
            ul.append(entry);
        });
        return ul;
    }

    var c = $('<div>');

    var ul0 = c.clone().append($('.submodule-index'))

    customIndex = $('.custom-index');
    customIndex.empty();
    customIndex.append(ul0);

    var l = createList('dl.method > dt, dl.function > dt');
    if (l) {
        var ul = c.clone()
            .append('<h3>Methods / Functions</h3>')
            .append(l);
    }
    customIndex.append(ul);
});