aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/search.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2017-01-11 12:32:39 +0100
committerNoah Loomans <noahloomans@gmail.com>2017-01-11 12:32:39 +0100
commitc3286dbef4648668979e04cc918e333dbdf1fb15 (patch)
tree7819709e156d9286fc37f8e920e5a40e9744f424 /public/javascripts/search.js
parentcb411ca3e2c5b6f30c351cec5af94e9c1f32102d (diff)
parent55409fc3c92f150fa702065e65c8c322eb0bd1be (diff)
Merge branch 'master' of github.com:nloomans/rooster-mml
Diffstat (limited to 'public/javascripts/search.js')
-rw-r--r--public/javascripts/search.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/public/javascripts/search.js b/public/javascripts/search.js
index 3f223ec..a07d6dd 100644
--- a/public/javascripts/search.js
+++ b/public/javascripts/search.js
@@ -13,13 +13,14 @@ self._nodes = {
}
self.submit = function () {
- self._nodes.input.blur()
- document.body.classList.remove('week-selector-not-visible') // Safari bug
-
const selectedItem = autocomplete.getSelectedItem()
+ if (selectedItem == null) return
console.log(selectedItem)
+ self._nodes.input.blur()
+ document.body.classList.remove('week-selector-not-visible') // Safari bug
+
self.emit('search', selectedItem)
}