commit:ec5e57cc0f39e47903322f3259b2f28b982e0d15
author:Chip Black
committer:Chip Black
date:Tue Jun 17 21:43:33 2014 -0500
parents:0d038928d70d93531bf2587abd44e7648057f0ab
Can now login by pressing enter in the login field
diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js
line changes: +11/-1
index f386627..21d4a59
--- a/www/jssrc/blerg/Controls.js
+++ b/www/jssrc/blerg/Controls.js
@@ -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;