Can now login by pressing enter in the login field
authorChip Black <bytex64@bytex64.net>
Wed, 18 Jun 2014 02:43:33 +0000 (21:43 -0500)
committerChip Black <bytex64@bytex64.net>
Wed, 18 Jun 2014 03:07:07 +0000 (22:07 -0500)
www/jssrc/blerg/Controls.js

index f386627..21d4a59 100644 (file)
@@ -15,7 +15,7 @@ enyo.kind({
     },
     components: [
         {name: "loggedOutControls", components: [
-            {tag: "form", onsubmit: "loginClicked", classes: "login", components: [
+            {tag: "form", onkeyup: "loginKeyUp", classes: "login", components: [
                 {kind: "onyx.Groupbox", components: [
                     {kind: "onyx.InputDecorator", components: [
                         {name: "username", kind: "onyx.Input", placeholder: "Username", attributes: {tabindex: 1}}
@@ -72,6 +72,16 @@ enyo.kind({
         inEvent.preventDefault();
         return true;
     },
+    loginKeyUp: function(inSender, inEvent) {
+        if (inEvent.keyCode == 13) {
+            if (this.$.username.hasFocus()) {
+                this.$.password.focus();
+            } else {
+                this.loginClicked(this, inEvent);
+            }
+            return true;
+        }
+    },
     logoutClicked: function() {
         this.bubble('onTryLogout');
         return true;