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:
commit
196243ed9b
1 changed files with 5 additions and 0 deletions
|
@ -140,4 +140,9 @@ function createSourceSidebar() {
|
||||||
});
|
});
|
||||||
|
|
||||||
main.insertBefore(sidebar, main.firstChild);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue