diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-03 16:39:36 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-03 16:39:36 +0200 |
commit | 8f8069022a1869c45a009cbe1ffe10a0ad48965d (patch) | |
tree | 704cbc347316c0b7431eb24b0f849f5aaa118eee /js | |
parent | 29c878f4400dbb508e44bc5f40f558d40906bc67 (diff) |
if dialog input text elements are focused, enter commits the form
Diffstat (limited to 'js')
-rw-r--r-- | js/main.js | 6 |
1 files changed, 6 insertions, 0 deletions
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'); + } + }); + }); |