summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-03-28 10:19:28 +0000
committerrobin <robin@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-03-28 10:19:28 +0000
commitf84e3b4bda2d903fe1f4269753f3584c919ad31d (patch)
tree3dd8e216708246441e010e76198d00c03f770da7
parent20c6a7ba52df133b4e9a144533c63e201a4a021d (diff)
Login screen: Set focus to password field if enter was pressed in username field.
git-svn-id: https://svn.roundcube.net/trunk@526 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/program/js/app.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 2f4b471c5..e166d07da 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/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;
+ }
+ };
/*********************************************************/