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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/usage_statistics.tt (-20 / +24 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
    function positionMap() {
14
    $(window).scroll(function () {
15
        var tbh = $("#mapid");
14
        var tbh = $("#mapid");
16
        var offsetTop = tbh.offset().top;
15
        var mapContainer = tbh.parent();
16
        mapContainer.css('position', 'relative');
17
        mapContainer.css('min-height', tbh.outerHeight(true));
18
        tbh.css('position', 'absolute');
19
        tbh.css('right', 0);
20
21
        var offsetTop = mapContainer.offset().top;
17
        var s = parseInt($(window).scrollTop(), 10);
22
        var s = parseInt($(window).scrollTop(), 10);
18
        var fixMe = (s > offsetTop);
23
        tbh.css('top', '').css('bottom', '');
19
        if ( !originalOffset ) originalOffset = tbh.position().top;
24
        if (s > offsetTop) {
20
        var repositionMe = (s < originalOffset);
25
            var mapContainerOffsetBottom = offsetTop + mapContainer.innerHeight();
21
        if (fixMe) {
26
            if (s + tbh.outerHeight(true) > mapContainerOffsetBottom) {
22
            tbh.css({
27
                tbh.css('bottom', 0);
23
                'position': 'fixed',
28
            } else {
24
                    'top': '0',
29
                tbh.css('top', s - offsetTop);
25
                'margin-left': '40%'
30
            }
26
            });
31
        } else {
27
        }
32
            tbh.css('top', 0);
28
        if (repositionMe) {
29
            tbh.css({
30
                'position': 'absolute',
31
                    'top': originalOffset,
32
                'margin-left': '40%'
33
            });
34
        }
33
        }
34
    }
35
36
    $(document).ready(function() {
37
        $(window).scroll(positionMap);
38
        positionMap();
35
    });
39
    });
36
//]]>
40
//]]>
37
</script>
41
</script>
Lines 321-326 Link Here
321
        $("#UsageStatsLibrariesInfo").on('change', function(){
325
        $("#UsageStatsLibrariesInfo").on('change', function(){
322
            if ( $(this).val() == 1 ) $("#libraries_info").show()
326
            if ( $(this).val() == 1 ) $("#libraries_info").show()
323
            else $("#libraries_info").hide();
327
            else $("#libraries_info").hide();
328
            positionMap();
324
        });
329
        });
325
330
326
    </script>
331
    </script>
327
- 

Return to bug 18066