mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 08:16:53 +00:00
Account for header when locking the sidebar (#15847)
This commit is contained in:
parent
7c45fce74f
commit
2d95b176f7
@ -37,8 +37,9 @@
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const sidebar = document.querySelector("#sidebar").querySelector(".grid");
|
const sidebar = document.querySelector("#sidebar").querySelector(".grid");
|
||||||
if (sidebar) {
|
if (sidebar) {
|
||||||
const content = document.querySelector(".page-content").querySelector(".grid-wrapper")
|
const content = document.querySelector(".page-content").querySelector(".grid-wrapper");
|
||||||
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > window.innerHeight) {
|
const windowHeight = window.innerHeight - 82;
|
||||||
|
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > windowHeight) {
|
||||||
sidebar.style.display = "contents"
|
sidebar.style.display = "contents"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user