authentication: add focus + renamed function
This commit is contained in:
parent
604494cee9
commit
bc7504824a
@ -29,7 +29,7 @@ export default class extends AbstractNonAuthenticatedView
|
||||
let new_mode = location.pathname.slice(1);
|
||||
this.update_mode(new_mode);
|
||||
|
||||
document.getElementById("button").onclick = this.authencation.bind(this);
|
||||
document.getElementById("button").onclick = this.authentication.bind(this);
|
||||
|
||||
let username_input = document.getElementById('username-input'),
|
||||
password_input = document.getElementById('password-input');
|
||||
@ -37,9 +37,10 @@ export default class extends AbstractNonAuthenticatedView
|
||||
[username_input, password_input].forEach(input => {
|
||||
input.addEventListener('keydown', async ev => {
|
||||
if (ev.key === 'Enter')
|
||||
await this.authencation.bind(this)()
|
||||
await this.authentication.bind(this)()
|
||||
});
|
||||
});
|
||||
username_input.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -114,7 +115,7 @@ export default class extends AbstractNonAuthenticatedView
|
||||
/**
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async authencation()
|
||||
async authentication()
|
||||
{
|
||||
let username = document.getElementById("username-input").value,
|
||||
password = document.getElementById("password-input").value;
|
||||
@ -171,4 +172,4 @@ export default class extends AbstractNonAuthenticatedView
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user