From 1aa2466243f194ab48d8286a6fa60f32b3dab19b Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 12 Jun 2012 09:05:14 +0000 Subject: [PATCH] handle enter key press on login form git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1349202 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/redback/user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index c3137a1f9..03e0fcb3a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -327,13 +327,18 @@ define("redback.user",["jquery","order!utils","i18n","jquery.validate","order!kn if (window.modalLoginWindow==null) { window.modalLoginWindow = $("#modal-login").modal(); window.modalLoginWindow.on('hidden', function () { - $("#modal-login-err-message").html(""); + $("#modal-login-err-message").hide(); removeValidationErrorMessages("#user-login-form"); }); // focus on user name window.modalLoginWindow.on('shown', function (e) { $("#user-login-form-username" ).focus(); - }) + }); + window.modalLoginWindow.keypress( function (event) { + if (event.which==13){ + $("#modal-login-ok" ).trigger("click"); + } + }); } var userLoginForm = $("#user-login-form");