var searchLoop = function()

in 0.5.0-incubating/hive/scaladocs/lib/index.js [395:428]


    var searchLoop = function () {
        var packages = Index.keys(Index.PACKAGES).sort();

        while (packages[index]) {
            var pack = packages[index];
            var children = Index.PACKAGES[pack];
            index++;

            if (focusFilterState) {
                if (pack == focusFilterState ||
                    pack.indexOf(focusFilterState + '.') == 0) {
                    ;
                } else {
                    continue;
                }
            }

            var matched = $.grep(children, function (child, i) {
                return queryRegExp.test(child.name);
            });

            if (matched.length > 0) {
                $('#tpl').append(Index.createPackageTree(pack, matched,
                                                         focusFilterState));
                scheduler.add('filter', searchLoop);
                return;
            }
        }

        $('#tpl a.packfocus').click(function () {
            focusFilter($(this).parent().parent());
        });
        configureHideFilter();
    };