Skip to content

Commit 9e567b0

Browse files
committed
Use HTML5 instead of JS to autofocus on search box
1 parent 419db6a commit 9e567b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

html/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function setup_search_box() {
1919
to be trying to scroll the page with keyboard, rather than typing
2020
a search query
2121
*/
22-
$('#query').focus().keydown( function(e){
22+
$('#query').keydown( function(e){
2323
var el = $(this);
2424
if ( e.which == 32 && el.val().length ) { return true; }
2525
if ( e.which == 32 || e.which == 34 || e.which == 40 ) { el.blur() ; }

template/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
>&nbsp;Perl 6 Documentation</a
55
>
66
<div id="search" class="ui-widget">
7-
<div class="green"><input placeholder="Search" id="query" title="Enter Perl 6 document to search for"></div>
7+
<div class="green"><input placeholder="Search" autofocus id="query" title="Enter Perl 6 document to search for"></div>
88
</div>
99
<div class="menu">
1010
MENU

0 commit comments

Comments
 (0)