From 361180de0258d997f96b3c90fa4e6496332a0b4a Mon Sep 17 00:00:00 2001 From: bryanmr Date: Tue, 13 Apr 2010 20:16:08 +0000 Subject: [PATCH] Made it so that the login dialog works properly with Chrome. Don't know if I broke it in something else, but Firefox and Chrome work. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5762 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/xcatauth.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/xCAT-UI/js/xcatauth.js b/xCAT-UI/js/xcatauth.js index c04ad5d1c..2ed083701 100644 --- a/xCAT-UI/js/xcatauth.js +++ b/xCAT-UI/js/xcatauth.js @@ -83,22 +83,19 @@ function openDialog(){ }); $("#username").keydown(function(event) { //When 'enter' is hit while in username, advance to password - if (event.keyCode==13) { + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + event.preventDefault(); $("#password").focus(); } }); + $("#password").keydown(function(event) { //Submit authentication if enter is pressed in password field - if (event.keyCode==13) { - //TODO: it doesn't work on Chrome and Safari - $(".ui-dialog-buttonpane button").each(function() { - if($(this).html() == "Log In") { - $(this).click(); - } - }); - //authenticate(); + if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) { + event.preventDefault(); + authenticate(); } }); - + $("#logout").click(function(event){ logout(); });