{#-
    modern5/layout.html
    ~~~~~~~~~~~~~~~~~~~

    Layout for Modern5 theme.

    :copyright: Copyright 2012 by Vlad Riscutia and contributors (see
    CONTRIBUTORS file)
    :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(document.getElementsByClassName("document")[0].offsetTop - 44);
            }
        });
    </script>
{%- endblock -%}
