diff options
author | koirand <koirand.jp@gmail.com> | 2020-02-23 19:11:02 +0300 |
---|---|---|
committer | koirand <koirand.jp@gmail.com> | 2020-02-23 19:11:02 +0300 |
commit | b939893c3aed0ebe046076f6bf9afc39683001d4 (patch) | |
tree | 0c77d7b5dbd24633d13ca1acd7d21b505d97f208 | |
parent | 1fe952e1a54e0a2c7c33de1095971926cb1b1869 (diff) |
Focus search box when page opened.
-rw-r--r-- | assets/js/search.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/assets/js/search.js b/assets/js/search.js index a4f2f24..79ff895 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -96,6 +96,7 @@ const initUI = () => { $('#searchBoxIcon').click(() => { $('#searchBoxInput').val('') $('#searchBoxInput').trigger('keyup') + $('#searchBoxInput').focus() }) // Event when chenging query @@ -126,6 +127,9 @@ const initUI = () => { // Emit keyup event for when the query is already setted with browser back etc. $('#searchBoxInput').trigger('keyup') + + // Focus at searchBox + $('#searchBoxInput').focus() } /** |