Skip to content

Commit

Permalink
rustdoc: when resizing the sidebar to nothing, clear size setting
Browse files Browse the repository at this point in the history
This way, when the sidebar is restored, it comes back at default size.
  • Loading branch information
notriddle committed Sep 11, 2023
1 parent aa64872 commit 54fbbed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,13 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
const hideSidebar = () => {
if (isSrcPage) {
window.rustdocCloseSourceSidebar();
updateLocalStorage("src-sidebar-width", null);
document.documentElement.style.removeProperty("--src-sidebar-width");
} else {
addClass(document.documentElement, "hide-sidebar");
updateLocalStorage("hide-sidebar", "true");
updateLocalStorage("desktop-sidebar-width", null);
document.documentElement.style.removeProperty("--desktop-sidebar-width");
}
};
const showSidebar = () => {
Expand Down

0 comments on commit 54fbbed

Please sign in to comment.