Skip to content

Commit 771c641

Browse files
committed
main.js: only call window.rustdocToggleSrcSidebar if it exists
1 parent 4a2d6df commit 771c641

File tree

1 file changed

+1
-2
lines changed
  • src/librustdoc/html/static/js

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,8 +1825,7 @@ function preLoadCss(cssUrl) {
18251825
sidebarButton.addEventListener("click", e => {
18261826
removeClass(document.documentElement, "hide-sidebar");
18271827
updateLocalStorage("hide-sidebar", "false");
1828-
if (document.querySelector(".rustdoc.src")) {
1829-
// @ts-expect-error
1828+
if (window.rustdocToggleSrcSidebar) {
18301829
window.rustdocToggleSrcSidebar();
18311830
}
18321831
e.preventDefault();

0 commit comments

Comments
 (0)