Release notes for 1.9.1
[blerg.git] / www / jssrc / blerg / Controls.js
index f386627..0827ff7 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,12 +72,24 @@ 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;
     },
     login: function(inSender, inEvent) {
         this.$.password.setValue('');
+        // TODO: Replace with regular blur() call in future enyo
+        this.$.password.node.blur();
         this.setLoggedIn(true);
         this.$.userlink.setAttribute('href', '/#' + inEvent.username);
         this.$.userlink.setContent('@' + inEvent.username);