blob: 172c2a6a456869b2eb4e0a8c997ceccbd8f973e5 (
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
 | (function (factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else {
        factory(jQuery);
    }
}(function ($) {
    function getSubcalls(row) {
        var id = row.attr('id');
        return $('.djDebugProfileRow[id^="'+id+'_"]');
    }
    function getDirectSubcalls(row) {
        var subcalls = getSubcalls(row);
        var depth = parseInt(row.attr('depth'), 10) + 1;
        return subcalls.filter('[depth='+depth+']');
    }
    $('.djDebugProfileRow .djDebugProfileToggle').on('click', function(){
        var row = $(this).closest('.djDebugProfileRow');
        var subcalls = getSubcalls(row);
        if (subcalls.css('display') == 'none') {
            getDirectSubcalls(row).show();
        } else {
            subcalls.hide();
        }
    });
}));
 |