From 8f8069022a1869c45a009cbe1ffe10a0ad48965d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 3 Sep 2012 16:39:36 +0200 Subject: if dialog input text elements are focused, enter commits the form --- js/main.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js') diff --git a/js/main.js b/js/main.js index 467316c03..06b7cab99 100644 --- a/js/main.js +++ b/js/main.js @@ -138,6 +138,12 @@ $(document).ready(function(){ } }); + $('.dialog input[type=text]').keyup(function(e){ + if((e.keyCode || e.which) == 13) { // 'enter' key shortcut + $(this).parent().parent().find('input[type=submit]').trigger('click'); + } + }); + }); -- cgit v1.2.3