View | Details | Raw Unified | Return to bug 18066
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt (-22 / +23 lines)
Lines 10-37 Link Here
10
10
11
<script type="text/javascript">
11
<script type="text/javascript">
12
//<![CDATA[
12
//<![CDATA[
13
    var originalOffset;
13
    $(document).ready(function() {
14
    $(window).scroll(function () {
14
        function positionMap() {
15
        var tbh = $("#mapid");
15
            var tbh = $("#mapid");
16
        var offsetTop = tbh.offset().top;
16
            var mapContainer = tbh.parent();
17
        var s = parseInt($(window).scrollTop(), 10);
17
            mapContainer.css('position', 'relative');
18
        var fixMe = (s > offsetTop);
18
            tbh.css('position', 'absolute');
19
        if ( !originalOffset ) originalOffset = tbh.position().top;
19
20
        var repositionMe = (s < originalOffset);
20
            var offsetTop = mapContainer.offset().top;
21
        if (fixMe) {
21
            var s = parseInt($(window).scrollTop(), 10);
22
            tbh.css({
22
            tbh.css('top', '').css('bottom', '');
23
                'position': 'fixed',
23
            if (s > offsetTop) {
24
                    'top': '0',
24
                var mapContainerOffsetBottom = offsetTop + mapContainer.innerHeight();
25
                'margin-left': '40%'
25
                if (s + tbh.outerHeight(true) > mapContainerOffsetBottom) {
26
            });
26
                    tbh.css('bottom', 0);
27
        }
27
                } else {
28
        if (repositionMe) {
28
                    tbh.css('top', s - offsetTop);
29
            tbh.css({
29
                }
30
                'position': 'absolute',
30
            } else {
31
                    'top': originalOffset,
31
                tbh.css('top', 0);
32
                'margin-left': '40%'
32
            }
33
            });
34
        }
33
        }
34
35
        $(window).scroll(positionMap);
36
        positionMap();
35
    });
37
    });
36
//]]>
38
//]]>
37
</script>
39
</script>
38
- 

Return to bug 18066