summaryrefslogtreecommitdiffstats
path: root/js/directive/NewsSearch.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/directive/NewsSearch.js')
-rw-r--r--js/directive/NewsSearch.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/js/directive/NewsSearch.js b/js/directive/NewsSearch.js
index cee956109..ca8de9744 100644
--- a/js/directive/NewsSearch.js
+++ b/js/directive/NewsSearch.js
@@ -19,13 +19,11 @@ app.directive('newsSearch', function ($document, $location) {
var box = $('#searchbox');
box.val($location.search().search);
- box.on('keyup', function (e) {
- if (e.keyCode === 13) {
- var value = $(this).val();
- scope.$apply(function () {
- scope.onSearch(value);
- });
- }
+ box.on('search', function () {
+ var value = $(this).val();
+ scope.$apply(function () {
+ scope.onSearch(value);
+ });
});
// carry over search on route change