Skip to content

Commit

Permalink
Prevent enter from reloading page
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcbride committed Jan 15, 2015
1 parent 75afcc4 commit f673edf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ $("#searchbox").click(function () {
$(this).select();
});

/* Prevent hitting enter from refreshing the page */
$("#searchbox").keypress(function (e) {
if (e.which == 13) {
e.preventDefault();
}
});

/* Typeahead search functionality */
$(document).one("ajaxStop", function () {
$("#loading").hide();
Expand Down

0 comments on commit f673edf

Please sign in to comment.