diff options
author | svncommit <devs@roundcube.net> | 2007-03-28 10:19:28 +0000 |
---|---|---|
committer | svncommit <devs@roundcube.net> | 2007-03-28 10:19:28 +0000 |
commit | b566ffd2276bf469fd0e850dade0da18a4f0835b (patch) | |
tree | ef03c190464702adf94642fd2005381eed6ce055 /program/js | |
parent | dc096918d85274b934a029a23cbc594c790f3e19 (diff) |
Login screen: Set focus to password field if enter was pressed in username field.
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js index 2f4b471c5..e166d07da 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -274,6 +274,8 @@ function rcube_webmail() case 'login': var input_user = rcube_find_object('_user'); var input_pass = rcube_find_object('_pass'); + if (input_user) + input_user.onkeypress = function(e){ return rcmail.login_user_keypress(e); }; if (input_user && input_user.value=='') input_user.focus(); else if (input_pass) @@ -1627,6 +1629,26 @@ function rcube_webmail() return null; }; + + + /*********************************************************/ + /********* login form methods *********/ + /*********************************************************/ + + // handler for keyboard events on the _user field + this.login_user_keypress = function(e) + { + if (!e) + e = window.event; + var key = e.keyCode ? e.keyCode : e.which; + + // enter + if ((key==13) && (document.form._pass)) + { + rcube_find_object('_pass').focus(); + return false; + } + }; /*********************************************************/ |