prefix sidebar too

This commit is contained in:
steveklabnik 2017-09-22 13:58:45 -04:00
parent f562878131
commit 9b64db908f
2 changed files with 5 additions and 5 deletions

View File

@ -336,17 +336,17 @@ function sidebarToggle() {
var html = $("html"); var html = $("html");
if ( html.hasClass("sidebar-hidden") ) { if ( html.hasClass("sidebar-hidden") ) {
html.removeClass("sidebar-hidden").addClass("sidebar-visible"); html.removeClass("sidebar-hidden").addClass("sidebar-visible");
store.set('sidebar', 'visible'); store.set('mdbook-sidebar', 'visible');
} else if ( html.hasClass("sidebar-visible") ) { } else if ( html.hasClass("sidebar-visible") ) {
html.removeClass("sidebar-visible").addClass("sidebar-hidden"); html.removeClass("sidebar-visible").addClass("sidebar-hidden");
store.set('sidebar', 'hidden'); store.set('mdbook-sidebar', 'hidden');
} else { } else {
if($("#sidebar").position().left === 0){ if($("#sidebar").position().left === 0){
html.addClass("sidebar-hidden"); html.addClass("sidebar-hidden");
store.set('sidebar', 'hidden'); store.set('mdbook-sidebar', 'hidden');
} else { } else {
html.addClass("sidebar-visible"); html.addClass("sidebar-visible");
store.set('sidebar', 'visible'); store.set('mdbook-sidebar', 'visible');
} }
} }
} }

View File

@ -67,7 +67,7 @@
<!-- Hide / unhide sidebar before it is displayed --> <!-- Hide / unhide sidebar before it is displayed -->
<script type="text/javascript"> <script type="text/javascript">
var sidebar = store.get('sidebar'); var sidebar = store.get('mdbook-sidebar');
if (sidebar === "hidden") { $("html").addClass("sidebar-hidden") } if (sidebar === "hidden") { $("html").addClass("sidebar-hidden") }
else if (sidebar === "visible") { $("html").addClass("sidebar-visible") } else if (sidebar === "visible") { $("html").addClass("sidebar-visible") }
</script> </script>