mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
Fix sidebar footer overlap (#16181)
This commit is contained in:
parent
87c121ec1c
commit
ed301346b6
@ -36,10 +36,11 @@
|
|||||||
// Some sidebars are longer than the screen so they can't be locked.
|
// Some sidebars are longer than the screen so they can't be locked.
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const sidebar = document.querySelector("#sidebar").querySelector(".grid");
|
const sidebar = document.querySelector("#sidebar").querySelector(".grid");
|
||||||
|
const footer = document.querySelector("footer").querySelector(".grid")
|
||||||
if (sidebar) {
|
if (sidebar) {
|
||||||
const content = document.querySelector(".page-content").querySelector(".grid-wrapper");
|
const content = document.querySelector(".page-content").querySelector(".grid-wrapper");
|
||||||
const windowHeight = window.innerHeight - 82;
|
const windowHeight = window.innerHeight - 82;
|
||||||
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > windowHeight) {
|
if (sidebar.clientHeight > content.clientHeight || sidebar.clientHeight > windowHeight - footer.clientHeight) {
|
||||||
sidebar.style.display = "contents"
|
sidebar.style.display = "contents"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user