diff --git a/elections2021/templates/elections2021/_floating_navigation.html b/elections2021/templates/elections2021/_floating_navigation.html index df92cdf3381c9a919d2333048660ff7ede5cb02b..0875f0f7b5d6f62390f213eab87d02818693eddf 100644 --- a/elections2021/templates/elections2021/_floating_navigation.html +++ b/elections2021/templates/elections2021/_floating_navigation.html @@ -1,4 +1,4 @@ -<div class="floating-nav-wrapper hidden lg:block" id="floatingNavBarWrapper"> +<div class="floating-nav-wrapper hidden xl:block" id="floatingNavBarWrapper"> <div class="floating-nav-panel " id="floatingNavBar"> <div class="opener py-6 pb-16 px-11 bg-acidgreen text-white font-alt"> RYCHLÁ NAVIGACE diff --git a/elections2021/templates/elections2021/_question_block.html b/elections2021/templates/elections2021/_question_block.html index 0aa83c73aa42d0f87976c154a771011c72b432bf..78783cf739b3595056aac75a0ffcbf2b60f621bf 100644 --- a/elections2021/templates/elections2021/_question_block.html +++ b/elections2021/templates/elections2021/_question_block.html @@ -4,7 +4,7 @@ <h3 class="accordeon-row-heading head-alt-xs">{{ block.value.question }}</h3> <i class="ico--chevron-down"></i> </div> - <div class="accordeon-row-body" style="max-height: 216px;"> + <div class="accordeon-row-body accordeon-row-body--classic"> <div> <p>{{ block.value.answer|richtext|format_sources }}</p> </div> diff --git a/elections2021/templates/elections2021/elections2021_program_point_page.html b/elections2021/templates/elections2021/elections2021_program_point_page.html index 642d6fec5ac5df52a0675b8e9f8d1b0af71e165b..e62d808a0e6aab40d8b7048921878aee9f15f2ff 100644 --- a/elections2021/templates/elections2021/elections2021_program_point_page.html +++ b/elections2021/templates/elections2021/elections2021_program_point_page.html @@ -5,7 +5,7 @@ <div class="container container-default pt-4 pb-20"> <div class="w-full lg:w-4/6 relative container-collapsible"> - <div class="floating-nav-wrapper hidden lg:block" id="floatingNavBarWrapper"> + <div class="floating-nav-wrapper hidden xl:block" id="floatingNavBarWrapper"> <div class="floating-nav-panel " id="floatingNavBar"> <div class="opener py-6 pb-16 px-11 bg-acidgreen text-white font-alt"> RYCHLÁ NAVIGACE @@ -305,6 +305,20 @@ }; /*plus padding*/ } } + + document.addEventListener("DOMContentLoaded", setMaxHeights); + window.addEventListener('resize', setMaxHeights); + + function setMaxHeights() { + // set height for css transition + var accordeonRowBodies = document.getElementsByClassName('accordeon-row-body--classic'); + + if (accordeonRowBodies !== null) { + for (var i = 0; i < accordeonRowBodies.length; i++) { + accordeonRowBodies[i].style.maxHeight = accordeonRowBodies[i].scrollHeight + "px"; + }; + } + } </script> {% endblock %}