This commit is contained in:
Mo Bitar
2020-01-31 13:25:08 -06:00
parent 7ee89eb9ba
commit 76d1789a8e
4 changed files with 22 additions and 3 deletions

View File

@@ -23,6 +23,10 @@ import {
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';
const ELEMENT_NAME_AUTH_EMAIL = 'email';
const ELEMENT_NAME_AUTH_PASSWORD = 'password';
const ELEMENT_NAME_AUTH_PASSWORD_CONF = 'password_conf';
class AccountMenuCtrl extends PureCtrl {
/* @ngInject */
constructor(
@@ -104,10 +108,25 @@ class AccountMenuCtrl extends PureCtrl {
this.login(params);
}
blurAuthFields() {
const names = [
ELEMENT_NAME_AUTH_EMAIL,
ELEMENT_NAME_AUTH_PASSWORD,
ELEMENT_NAME_AUTH_PASSWORD_CONF
];
for(const name of names) {
const element = document.getElementsByName(name)[0];
if(element) {
element.blur();
}
}
}
submitAuthForm() {
if (!this.state.formData.email || !this.state.formData.user_password) {
return;
}
this.blurAuthFields();
if (this.state.formData.showLogin) {
this.login();
} else {

View File

@@ -50,7 +50,7 @@
type='password'
)
input.sk-input.contrast(
name='password',
name='password_conf',
ng-if='self.state.formData.showRegister',
ng-model='self.state.formData.password_conf',
placeholder='Confirm Password',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long