From ed301346b618cd74ed6ade59496248d8ffb50deb Mon Sep 17 00:00:00 2001 From: Tom Brien Date: Mon, 25 Jan 2021 14:55:55 +0000 Subject: [PATCH] Fix sidebar footer overlap (#16181) --- source/_includes/site/sidebar.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/_includes/site/sidebar.html b/source/_includes/site/sidebar.html index e3372e5f76c..375d78fd713 100644 --- a/source/_includes/site/sidebar.html +++ b/source/_includes/site/sidebar.html @@ -36,10 +36,11 @@ // Some sidebars are longer than the screen so they can't be locked. document.addEventListener('DOMContentLoaded', function() { const sidebar = document.querySelector("#sidebar").querySelector(".grid"); + const footer = document.querySelector("footer").querySelector(".grid") if (sidebar) { const content = document.querySelector(".page-content").querySelector(".grid-wrapper"); 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" } }