Skip to content

Commit

Permalink
Rollup merge of #74325 - GuillaumeGomez:focus-source-file-sidebar, r=…
Browse files Browse the repository at this point in the history
…kinnison

Focus on the current file in the source file sidebar

Fixes #73360.

r? @kinnison
cc @rust-lang/rustdoc
  • Loading branch information
Manishearth authored Jul 16, 2020
2 parents a80559f + 52c65e0 commit 196243e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librustdoc/html/static/source-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 196243e

Please sign in to comment.