diff options
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r-- | public/javascripts/search.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/public/javascripts/search.js b/public/javascripts/search.js index c1e6158..f0f905f 100644 --- a/public/javascripts/search.js +++ b/public/javascripts/search.js @@ -15,14 +15,19 @@ self.submit = function () { self._nodes.input.blur() const selectedItem = autocomplete.getSelectedItem() - self._nodes.input.value = selectedItem.value - autocomplete.removeAllItems() - document.body.classList.add('searched') + console.log(selectedItem) self.emit('search', selectedItem) } +self.updateDom = function (selectedItem) { + self._nodes.input.value = selectedItem.value + autocomplete.removeAllItems() + document.body.classList.remove('no-input') + document.body.classList.add('searched') +} + self._handleSubmit = function (event) { event.preventDefault() self.submit() |