projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generalize "new" button style
[blerg.git]
/
www
/
jssrc
/
blerg
/
Controls.js
diff --git
a/www/jssrc/blerg/Controls.js
b/www/jssrc/blerg/Controls.js
index
f386627
..
0827ff7
100644
(file)
--- a/
www/jssrc/blerg/Controls.js
+++ b/
www/jssrc/blerg/Controls.js
@@
-15,7
+15,7
@@
enyo.kind({
},
components: [
{name: "loggedOutControls", components: [
},
components: [
{name: "loggedOutControls", components: [
- {tag: "form", on
submit: "loginClicked
", classes: "login", components: [
+ {tag: "form", on
keyup: "loginKeyUp
", classes: "login", components: [
{kind: "onyx.Groupbox", components: [
{kind: "onyx.InputDecorator", components: [
{name: "username", kind: "onyx.Input", placeholder: "Username", attributes: {tabindex: 1}}
{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;
},
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('');
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);
this.setLoggedIn(true);
this.$.userlink.setAttribute('href', '/#' + inEvent.username);
this.$.userlink.setContent('@' + inEvent.username);