1
Fork 0

Rollup merge of #74325 - GuillaumeGomez:focus-source-file-sidebar, r=kinnison

Focus on the current file in the source file sidebar

Fixes #73360.

r? @kinnison
cc @rust-lang/rustdoc
This commit is contained in:
Manish Goregaokar 2020-07-16 11:18:52 -07:00 committed by GitHub
commit 196243ed9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,4 +140,9 @@ function createSourceSidebar() {
});
main.insertBefore(sidebar, main.firstChild);
// Focus on the current file in the source files sidebar.
var selected_elem = sidebar.getElementsByClassName("selected")[0];
if (typeof selected_elem !== "undefined") {
selected_elem.focus();
}
}