Account for header when locking the sidebar (#15847)

This commit is contained in:
Joakim Sørensen 2020-12-08 08:57:13 +01:00 committed by GitHub
parent 7c45fce74f
commit 2d95b176f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,9 @@
document.addEventListener('DOMContentLoaded', function() {
const sidebar = document.querySelector("#sidebar").querySelector(".grid");
if (sidebar) {
const content = document.querySelector(".page-content").querySelector(".grid-wrapper")
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > window.innerHeight) {
const content = document.querySelector(".page-content").querySelector(".grid-wrapper");
const windowHeight = window.innerHeight - 82;
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > windowHeight) {
sidebar.style.display = "contents"
}
}