From 161759b99a0384bc494f200a363cddb06d173af5 Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Mon, 24 Jan 2011 02:40:24 -0600 Subject: [PATCH] fix 789 --- public/javascripts/view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 228101a87..9bee29f0b 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -23,7 +23,9 @@ var View = { /* "Toggling" the search input */ $(this.search.selector) .blur(this.search.blur) - .focus(this.search.focus); + .focus(this.search.focus) + /* Submit the form when the user hits enter */ + .keypress(this.search.keyPress); /* Getting started animation */ $(this.gettingStarted.selector) @@ -118,6 +120,11 @@ var View = { focus: function() { $(this).addClass("active"); }, + keyPress: function(evt) { + if(evt.keyCode === 13) { + $(this).parent().submit(); + } + }, selector: "#q" },