Merge pull request #237 from BeaudanBrown/enter-to-login

Added enter to log in
pull/239/head
sachaaaaa 6 years ago committed by GitHub
commit 5fb1f2e1c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,7 @@
className: 'password full-screen-flow standalone-fullscreen',
templateName: 'password',
events: {
keyup: 'onKeyup',
'click #unlock-button': 'onLogin',
'click #reset-button': 'onReset',
},
@ -30,6 +31,16 @@
showReset: this.errorCount >= MIN_LOGIN_TRIES,
};
},
onKeyup(event) {
switch (event.key) {
case 'Enter':
this.onLogin();
break;
default:
return;
}
event.preventDefault();
},
async onLogin() {
const passPhrase = this.$('#passPhrase').val();
const trimmed = passPhrase ? passPhrase.trim() : passPhrase;

Loading…
Cancel
Save