aboutsummaryrefslogtreecommitdiff
path: root/public/javascripts/search.js
diff options
context:
space:
mode:
authorBuildTools <Noah Loomans>2017-01-08 18:11:22 +0100
committerBuildTools <Noah Loomans>2017-01-08 18:11:22 +0100
commita75f9cbf9c3543b8ed3c5a18a6c5be808101420b (patch)
tree8ed057c6a120308a206cc8c19f46f816c7b9c90b /public/javascripts/search.js
parent3aeeb70505252f7058420473fca6c37672d100d4 (diff)
fix crash when searching for non-existent user
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)
}