about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-07-18 08:13:16 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-07-18 08:13:16 +0530
commitfdc39cd50d4a082e62c3e7d53f2399a6c88f688e (patch)
tree1356f4ad365f4e4ce5167e24eabc1ce01f39f35a /src
parent99987a82b6977517d0bdf358fd97e2fca305d8fe (diff)
parentb3a9cd3a69a3b6d0729dbfe1af4db8ccfc359679 (diff)
downloadrust-fdc39cd50d4a082e62c3e7d53f2399a6c88f688e.tar.gz
rust-fdc39cd50d4a082e62c3e7d53f2399a6c88f688e.zip
Rollup merge of #27094 - tamird:DRY-search-focus, r=brson
Following up on comment from #26977.

r? @brson 
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 1eb1556a25d..b3ad4774091 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -115,7 +115,7 @@
         case "s":
         case "S":
             ev.preventDefault();
-            $(".search-input").focus();
+            focusSearchBar()
             break;
 
         case "?":
@@ -960,5 +960,5 @@
 
 // Sets the focus on the search bar at the top of the page
 function focusSearchBar() {
-    document.getElementsByName('search')[0].focus();
+    $('.search-input').focus();
 }