Source

tinkerer-fix-url-patch / tinkerer / themes / modern5 / layout.html

{#
    modern/layout.html
    ~~~~~~~~~~~~~~~~~~

    Layout for Modern theme.

    :copyright: Copyright 2011 by Vlad Riscutia
    :license: FreeBSD, see LICENSE file
#}

{%- extends "boilerplate/layout.html" -%}

{%- block extrahead -%}
    {{ super() }}

    <script type="text/javascript">
        $(document).ready(function () {
            // Adjusts document height if sidebar is taller
            var documentwrapper = document.getElementsByClassName("documentwrapper")[0];
            var sidebar = document.getElementsByClassName("sidebar")[0];

            if (sidebar.offsetHeight > documentwrapper.offsetHeight)
            {
                documentwrapper.style.minHeight = sidebar.offsetHeight + "px";
            }

            // Scroll to content if on small screen
            if (screen.width < 480)
            {
                $(document).scrollTop(documentwrapper.offsetTop - 44);
            }
        });
    </script>
{%- endblock -%}