dynamic height of asidenav to avoid over-long bodies

This commit is contained in:
Felix Hamann 2018-07-08 23:53:33 +02:00
parent 4993c7994c
commit 0531502b7d
2 changed files with 22 additions and 0 deletions

View File

@ -19,6 +19,21 @@
document.addEventListener('DOMContentLoaded', function() {
var asidenavEl = document.querySelector('.main__aside');
var mainContentEl = document.querySelector('.main__content');
function adjustHeight() {
window.requestAnimationFrame(function() {
asidenavEl.style.height = mainContentEl.clientHeight + 'px';
});
}
// unbeknownst to the user (below the fold), this happes slightly delayed
// because of dynamic changes to the styles inside the main__content
setTimeout(function() {
adjustHeight();
}, 10);
window.addEventListener('resize', adjustHeight);
window.utils.aside(asidenavEl);

View File

@ -16,6 +16,13 @@
}
}
@media (max-width: 768px) {
.main__aside {
min-height: calc(100% - var(--header-height-collapsed));
}
}
@media (max-width: 425px) {
.main__aside {