From fa6aa2ced885713cc5038c25b6d25ce12343631c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roy=20Wellington=20=E2=85=A3?= Date: Sat, 11 Feb 2023 18:04:58 -0500 Subject: [PATCH] Default the sidebar to visible in large screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code here leads me to believe that the intention is for the sidebar to be default visible on large screens (where `clientWidth` > 1080) and hidden otherwise. However, as previously written, if the `localStorage.getItem` call fails (for example, if the user agent is not accepting cookies), then we fall back to `sidebar = sidebar || 'visible';` — but `sidebar` is already set to `hidden`, so the `|| 'visible'` never happens. This results in the sidebar hiding itself on every navigation through an mdBook, meaning if you're just switching between sections trying to find something that you keep needing to re-open the sidebar. --- src/theme/index.hbs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 37a029b587..6f3948c652 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -92,10 +92,12 @@