aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/search.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2016-12-14 12:19:59 +0100
committerNoah Loomans <noahloomans@gmail.com>2016-12-14 12:19:59 +0100
commite3f1a6a2c3534c3133f412f1b86f7398f3b4f40c (patch)
treefa2e526929c83691fe6ee51b86f1c5a258c11c1d /public/javascripts/search.js
parent746abfd1827bf7d6d51c231b5509d5f609e71f07 (diff)
add favorite
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r--public/javascripts/search.js11
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()