Skip to content

Commit b3a9cd3

Browse files
committed
DRY
1 parent b5dad7d commit b3a9cd3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/librustdoc/html/static/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
case "s":
116116
case "S":
117117
ev.preventDefault();
118-
$(".search-input").focus();
118+
focusSearchBar()
119119
break;
120120

121121
case "?":
@@ -960,5 +960,5 @@
960960

961961
// Sets the focus on the search bar at the top of the page
962962
function focusSearchBar() {
963-
document.getElementsByName('search')[0].focus();
963+
$('.search-input').focus();
964964
}

0 commit comments

Comments
 (0)