Remove elements iterator clone and only keep first element instead
This commit is contained in:
parent
382d5bb715
commit
52c65e05f5
1 changed files with 3 additions and 3 deletions
|
@ -141,8 +141,8 @@ function createSourceSidebar() {
|
|||
|
||||
main.insertBefore(sidebar, main.firstChild);
|
||||
// Focus on the current file in the source files sidebar.
|
||||
var selected_elems = Array.prototype.slice.call(sidebar.getElementsByClassName("selected"));
|
||||
if (selected_elems.length > 0) {
|
||||
selected_elems[0].focus();
|
||||
var selected_elem = sidebar.getElementsByClassName("selected")[0];
|
||||
if (typeof selected_elem !== "undefined") {
|
||||
selected_elem.focus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue