diff --git a/public_html/js/Presenters/PostListPresenter.js b/public_html/js/Presenters/PostListPresenter.js index 40423206..8a046775 100644 --- a/public_html/js/Presenters/PostListPresenter.js +++ b/public_html/js/Presenters/PostListPresenter.js @@ -70,6 +70,7 @@ App.Presenters.PostListPresenter = function( $searchInput.val(searchArgs.query); $searchInput.keydown(searchInputKeyPressed); + $el.find('form').submit(searchFormSubmitted); keyboard.keyup('p', function() { $el.find('.posts li a').eq(0).focus(); @@ -101,7 +102,15 @@ App.Presenters.PostListPresenter = function( if (e.which !== KEY_RETURN) { return; } + updateSearch(); + } + function searchFormSubmitted(e) { + e.preventDefault(); + updateSearch(); + } + + function updateSearch() { $searchInput.blur(); pagerPresenter.setSearchParams({ query: $searchInput.val(), diff --git a/public_html/templates/post-list.tpl b/public_html/templates/post-list.tpl index 5124fd04..fa65f761 100644 --- a/public_html/templates/post-list.tpl +++ b/public_html/templates/post-list.tpl @@ -1,8 +1,8 @@
- +