Skip to content

Commit 32b9253

Browse files
committed
rustdoc: when resizing the sidebar to nothing, clear size setting
This way, when the sidebar is restored, it comes back at default size.
1 parent fdc6c49 commit 32b9253

File tree

1 file changed

+4
-0
lines changed
  • src/librustdoc/html/static/js

1 file changed

+4
-0
lines changed

src/librustdoc/html/static/js/main.js

+4
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,13 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
12481248
const hideSidebar = () => {
12491249
if (isSrcPage) {
12501250
window.rustdocCloseSourceSidebar();
1251+
updateLocalStorage("src-sidebar-width", null);
1252+
document.documentElement.style.removeProperty("--src-sidebar-width");
12511253
} else {
12521254
addClass(document.documentElement, "hide-sidebar");
12531255
updateLocalStorage("hide-sidebar", "true");
1256+
updateLocalStorage("desktop-sidebar-width", null);
1257+
document.documentElement.style.removeProperty("--desktop-sidebar-width");
12541258
}
12551259
};
12561260
const showSidebar = () => {

0 commit comments

Comments
 (0)