Skip to content

Commit 06fb651

Browse files
committed
Use no-js sidebar controls
1 parent f02ba77 commit 06fb651

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

main1.55.0.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -344,28 +344,6 @@ function hideThemeButtonState() {
344344
document.getElementsByTagName("body")[0].style.marginTop = "";
345345
}
346346

347-
function isInSidebarElems(elem) {
348-
while (elem) {
349-
if (elem.classList && elem.classList.contains("sidebar-elems")) {
350-
return true;
351-
}
352-
elem = elem.parentElement;
353-
}
354-
return false;
355-
}
356-
357-
function handleSidebarElemsFocus(e) {
358-
if (isInSidebarElems(e.relatedTarget) || isInSidebarElems(document.activeElement)) {
359-
showSidebar();
360-
}
361-
}
362-
363-
function handleSidebarElemsBlur(e) {
364-
if (!isInSidebarElems(e.relatedTarget)) {
365-
hideSidebar();
366-
}
367-
}
368-
369347
var toggleAllDocsId = "toggle-all-docs";
370348
var main = document.getElementById("main");
371349
var savedHash = "";
@@ -680,11 +658,6 @@ function hideThemeButtonState() {
680658
// `crates{version}.js` should always be loaded before this script, so we can use
681659
// it safely.
682660
addSidebarCrates(window.ALL_CRATES);
683-
684-
onEachLazy(sidebar.getElementsByTagName("a"), function(a) {
685-
a.onfocus = handleSidebarElemsFocus;
686-
a.onblur = handleSidebarElemsBlur;
687-
});
688661
}
689662
};
690663

rustdoc1.55.0.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,8 @@ details.undocumented[open] > summary::before {
17291729
width: calc(100% + 30px);
17301730
}
17311731

1732-
.show-it {
1732+
.show-it, .sidebar-elems:focus-within {
1733+
z-index: 2;
17331734
left: 0;
17341735
}
17351736

0 commit comments

Comments
 (0)