summaryrefslogtreecommitdiff
path: root/doc/build/static/init.js
blob: 4bcb4411daaac9820b43dbd8c7a89a9b1e814a4f (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

function initSQLPopups() {
    $('div.popup_sql').hide();
    $('a.sql_link').click(function() {
        $(this).nextAll('div.popup_sql:first').toggle();
        return false;
    });
}

var automatedBreakpoint = -1;

function initFloatyThings() {

    automatedBreakpoint = $("#docs-container").position().top + $("#docs-top-navigation-container").height();

    $("#fixed-sidebar.withsidebar").addClass("preautomated");


    function setScroll() {

        var scrolltop = $(window).scrollTop();
        if (scrolltop >= automatedBreakpoint) {
            $("#fixed-sidebar.withsidebar").css("top", 5);
        }
        else {
            $("#fixed-sidebar.withsidebar").css(
                "top", $("#docs-body").offset().top - Math.max(scrolltop, 0));
        }


    }
    $(window).scroll(setScroll)

    setScroll();
}


$(document).ready(function() {
    initSQLPopups();
    if (!$.browser.mobile) {
        initFloatyThings();
    }
});