aboutsummaryrefslogtreecommitdiff
path: root/static/pages/login
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-11-26 11:12:26 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2025-11-26 11:12:26 +0100
commit88443bbc2d4a4825dbcfd0bff107a3ed23c82aac (patch)
treec368e79111aa47d7d417f0fef11751f86d38509b /static/pages/login
parent4d5754d86c74b55e9ac8ce5996c3558201f8a72a (diff)
fix login
Diffstat (limited to 'static/pages/login')
-rw-r--r--static/pages/login/index.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/static/pages/login/index.js b/static/pages/login/index.js
index dae12e6..15a6016 100644
--- a/static/pages/login/index.js
+++ b/static/pages/login/index.js
@@ -34,11 +34,6 @@ export default class LoginView extends sfw.element.Container {
id: 'username',
placeholder: 'Username',
autocomplete: 'username',
- onkeydown: (e) => {
- if (e.key === 'Enter') {
- return this.#go_to_password();
- }
- },
}),
this.#password = Input.new({
id: 'password',
@@ -73,16 +68,17 @@ export default class LoginView extends sfw.element.Container {
}
#next() {
- if (this.#username.style.display == '') {
- this.#login();
- } else {
+ if (this.#username.style.display != 'none') {
this.#go_to_password();
+ } else {
+ this.#login();
}
}
#go_to_password() {
if (this.#username.value === '') return;
+ this.#user.innerText = this.#username.value;
this.#username.style.display = 'none';
this.#password.style.display = '';
this.#password.focus();
@@ -94,8 +90,11 @@ export default class LoginView extends sfw.element.Container {
}
#reset() {
- this.#username.value = '';
- this.#password.value = '';
+ this.#user.innerText = '';
+ this.#username.value = '';
+ this.#password.value = '';
+ this.#username.style.display = '';
+ this.#password.style.display = 'none';
}
set comment(value) {