aboutsummaryrefslogtreecommitdiff
path: root/public
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
parent3aeeb70505252f7058420473fca6c37672d100d4 (diff)
fix crash when searching for non-existent user
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/bundle.js9
-rw-r--r--public/javascripts/search.js7
2 files changed, 9 insertions, 7 deletions
diff --git a/public/javascripts/bundle.js b/public/javascripts/bundle.js
index 6e506b7..7c40828 100644
--- a/public/javascripts/bundle.js
+++ b/public/javascripts/bundle.js
@@ -1285,13 +1285,14 @@ self._nodes = {
};
self.submit = function () {
- self._nodes.input.blur();
- document.body.classList.remove('week-selector-not-visible'); // Safari bug
-
var 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);
};
@@ -1458,4 +1459,4 @@ self._nodes.nextButton.addEventListener('click', self._handleNextButtonClick);
module.exports = self;
},{"events":1}]},{},[11])
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvZXZlbnRzL2V2ZW50cy5qcyIsIm5vZGVfbW9kdWxlcy9mdXp6eS9saWIvZnV6enkuanMiLCJub2RlX21vZHVsZXMvbGVmdC1wYWQvaW5kZXguanMiLCJub2RlX21vZHVsZXMvc21vb3Roc2Nyb2xsLXBvbHlmaWxsL2Rpc3Qvc21vb3Roc2Nyb2xsLmpzIiwicHVibGljL2phdmFzY3JpcHRzL2FuYWx5dGljcy5qcyIsInB1YmxpYy9qYXZhc2NyaXB0cy9hdX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5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuIl19
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)
}