diff options
author | BuildTools <Noah Loomans> | 2016-12-08 22:40:08 +0100 |
---|---|---|
committer | BuildTools <Noah Loomans> | 2016-12-08 22:40:08 +0100 |
commit | c547e6910ea7ad077771343ae75a4204223a118a (patch) | |
tree | 4ee28699679ab8d106caca89dafdf496a2ea4190 /public/javascripts/search.js | |
parent | 3a9bdee97f9d05cbdb10f7530d4e94cf28d99602 (diff) |
use events and fix focus issues
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r-- | public/javascripts/search.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/public/javascripts/search.js b/public/javascripts/search.js index 8887ab2..fb40f78 100644 --- a/public/javascripts/search.js +++ b/public/javascripts/search.js @@ -21,8 +21,12 @@ self._handleSubmit = function (event) { self.submit() } +autocomplete.events.on('select', self.submit) + self._nodes.search.addEventListener('submit', self._handleSubmit) +self._nodes.input.addEventListener('focus', autocomplete.show) -console.log(self) +// TODO: hide on escape key press +// self._nodes.input.addEventListener('blur', autocomplete.hide) module.exports = self |