]> source.dussan.org Git - archiva.git/commitdiff
handle enter key press on login form
authorOlivier Lamy <olamy@apache.org>
Tue, 12 Jun 2012 09:05:14 +0000 (09:05 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 12 Jun 2012 09:05:14 +0000 (09:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1349202 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js

index c3137a1f9fb5fff892f8dd09562ce7e1867bff56..03e0fcb3aed16ceff8b01cb08276a33e4b190680 100644 (file)
@@ -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");