Autofocus the search field on the index page
This commit is contained in:
parent
00548468ac
commit
bdc536d126
2 changed files with 7 additions and 1 deletions
|
@ -128,4 +128,10 @@ $(document).ready(function () {
|
|||
if ($("#query").val()) {
|
||||
$("#search_form").submit();
|
||||
}
|
||||
|
||||
// Focus the search field for browsers that don't support
|
||||
// the HTML5 'autofocus' attribute
|
||||
if (!("autofocus" in document.createElement("input"))) {
|
||||
$("#query").focus();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue