From ec5e57cc0f39e47903322f3259b2f28b982e0d15 Mon Sep 17 00:00:00 2001 From: Chip Black Date: Tue, 17 Jun 2014 21:43:33 -0500 Subject: [PATCH] Can now login by pressing enter in the login field --- www/jssrc/blerg/Controls.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/www/jssrc/blerg/Controls.js b/www/jssrc/blerg/Controls.js index f386627..21d4a59 100644 --- 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; -- 2.25.1