dynamic height of asidenav to avoid over-long bodies
This commit is contained in:
parent
4993c7994c
commit
0531502b7d
@ -19,6 +19,21 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
var asidenavEl = document.querySelector('.main__aside');
|
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);
|
window.utils.aside(asidenavEl);
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
|
||||||
|
.main__aside {
|
||||||
|
min-height: calc(100% - var(--header-height-collapsed));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 425px) {
|
@media (max-width: 425px) {
|
||||||
|
|
||||||
.main__aside {
|
.main__aside {
|
||||||
|
|||||||
Reference in New Issue
Block a user