handle enter key press on login form

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1349202 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-06-12 09:05:14 +00:00
parent d9a2049ab4
commit 1aa2466243
1 changed files with 7 additions and 2 deletions

View File

@ -327,13 +327,18 @@ define("redback.user",["jquery","order!utils","i18n","jquery.validate","order!kn
if (window.modalLoginWindow==null) { if (window.modalLoginWindow==null) {
window.modalLoginWindow = $("#modal-login").modal(); window.modalLoginWindow = $("#modal-login").modal();
window.modalLoginWindow.on('hidden', function () { window.modalLoginWindow.on('hidden', function () {
$("#modal-login-err-message").html(""); $("#modal-login-err-message").hide();
removeValidationErrorMessages("#user-login-form"); removeValidationErrorMessages("#user-login-form");
}); });
// focus on user name // focus on user name
window.modalLoginWindow.on('shown', function (e) { window.modalLoginWindow.on('shown', function (e) {
$("#user-login-form-username" ).focus(); $("#user-login-form-username" ).focus();
}) });
window.modalLoginWindow.keypress( function (event) {
if (event.which==13){
$("#modal-login-ok" ).trigger("click");
}
});
} }
var userLoginForm = $("#user-login-form"); var userLoginForm = $("#user-login-form");