aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/search.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2016-12-14 12:40:20 +0100
committerNoah Loomans <noahloomans@gmail.com>2016-12-14 12:40:20 +0100
commit4d1c0fe2b6bbb180bf86c1195e1c80a4769d61e6 (patch)
tree00bac65b4e64e71732b3fa45f77b7bd1154341e1 /public/javascripts/search.js
parent819f3dd2088777c4d84a707b4bd62559382f36f5 (diff)
auto focus input on page load
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r--public/javascripts/search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/public/javascripts/search.js b/public/javascripts/search.js
index 8ae3043..7d80709 100644
--- a/public/javascripts/search.js
+++ b/public/javascripts/search.js
@@ -29,6 +29,10 @@ self.updateDom = function (selectedItem) {
document.body.classList.add('searched')
}
+self.focus = function () {
+ self._nodes.input.focus()
+}
+
self._handleSubmit = function (event) {
event.preventDefault()
self.submit()