Merge pull request #2017 from thanatos/roy/fix-sidebar
Default the sidebar to visible in large screens
This commit is contained in:
commit
c15220d1a1
|
@ -92,10 +92,12 @@
|
||||||
<!-- Hide / unhide sidebar before it is displayed -->
|
<!-- Hide / unhide sidebar before it is displayed -->
|
||||||
<script>
|
<script>
|
||||||
var html = document.querySelector('html');
|
var html = document.querySelector('html');
|
||||||
var sidebar = 'hidden';
|
var sidebar = null;
|
||||||
if (document.body.clientWidth >= 1080) {
|
if (document.body.clientWidth >= 1080) {
|
||||||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||||||
sidebar = sidebar || 'visible';
|
sidebar = sidebar || 'visible';
|
||||||
|
} else {
|
||||||
|
sidebar = 'hidden';
|
||||||
}
|
}
|
||||||
html.classList.remove('sidebar-visible');
|
html.classList.remove('sidebar-visible');
|
||||||
html.classList.add("sidebar-" + sidebar);
|
html.classList.add("sidebar-" + sidebar);
|
||||||
|
|
Loading…
Reference in New Issue