From c5a705d7469117b3480ecd862fdab26431e1e667 Mon Sep 17 00:00:00 2001 From: Rushan Date: Fri, 23 Sep 2022 23:51:49 +0400 Subject: [PATCH] Fix doc menu and search being hidden on mobile (#579) We might need to enable TOC on all pages to maintain the original mobile menu design. --- source/_static/js/main.js | 2 +- source/_static/scss/includes/_toc.scss | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/_static/js/main.js b/source/_static/js/main.js index 7af82648..8721cfc4 100644 --- a/source/_static/js/main.js +++ b/source/_static/js/main.js @@ -107,7 +107,7 @@ window.addEventListener("DOMContentLoaded", (event) => { tocTargetEl.parentNode.replaceChild(tocOriginalEl, tocTargetEl); } else { - tocAsideEL.style.display = "none"; + tocAsideEL.classList.add("content__toc--empty"); } // Treat the TOC as a dropdown in mobile diff --git a/source/_static/scss/includes/_toc.scss b/source/_static/scss/includes/_toc.scss index 24acbf77..8ac07e62 100644 --- a/source/_static/scss/includes/_toc.scss +++ b/source/_static/scss/includes/_toc.scss @@ -57,6 +57,12 @@ div.topic { } } +.content__toc--empty { + @include breakpoint-min(breakpoints(lg)) { + display: none; + } +} + #table-of-contents { flex: 1; position: relative;