This commit is contained in:
tonytins 2023-04-01 00:12:38 +00:00
parent 01ef604533
commit 49dec67afb
7 changed files with 19 additions and 7 deletions

View file

@ -72,10 +72,12 @@
<!-- Hide / unhide sidebar before it is displayed -->
<script>
var html = document.querySelector('html');
var sidebar = 'hidden';
var sidebar = null;
if (document.body.clientWidth >= 1080) {
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
sidebar = sidebar || 'visible';
} else {
sidebar = 'hidden';
}
html.classList.remove('sidebar-visible');
html.classList.add("sidebar-" + sidebar);