summaryrefslogtreecommitdiff
path: root/web/js
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-07-23 22:12:02 +0200
committerpennae <github@quasiparticle.net>2022-07-23 23:54:19 +0200
commit2e65f3bb5e561d1d44290b42d43312b52341c45b (patch)
tree9c755663fcd547883ba3e8bbd7d19f8bbf32f97f /web/js
parentdbfb5500fc22c3e773221ca398547bc5b3dd35d0 (diff)
downloadminor-skulk-2e65f3bb5e561d1d44290b42d43312b52341c45b.tar.gz
minor-skulk-2e65f3bb5e561d1d44290b42d43312b52341c45b.tar.xz
minor-skulk-2e65f3bb5e561d1d44290b42d43312b52341c45b.zip
auto-focus input fields
Diffstat (limited to 'web/js')
-rw-r--r--web/js/main.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/js/main.js b/web/js/main.js
index cefb003..edb41b1 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -252,6 +252,10 @@ class CredentialsForm extends HTMLElement {
}));
});
}
+
+ connectedCallback() {
+ this.querySelector("form")['email'].focus();
+ }
};
customElements.define('credentials-form', CredentialsForm);
@@ -331,6 +335,10 @@ class SigninConfirm extends HTMLElement {
}
});
}
+
+ connectedCallback() {
+ this.shadowRoot.querySelector("form")['code'].focus();
+ }
};
customElements.define('do-signin-confirm', SigninConfirm);
@@ -360,6 +368,10 @@ class ResetPassword extends HTMLElement {
switchTo(new ResetPasswordCreate(frm['email'].value, reset_token.accountResetToken));
});
}
+
+ connectedCallback() {
+ this.shadowRoot.querySelector("form")['email'].focus();
+ }
};
customElements.define('do-resetpw', ResetPassword);
@@ -378,9 +390,14 @@ class ResetPasswordCreate extends HTMLElement {
}
let c = new AuthClient(client_config.auth_server_base_url);
await c.accountReset(email, frm['new'].value, reset_token);
+ window.location.hash = "";
switchTo(new Signin());
};
}
+
+ connectedCallback() {
+ this.shadowRoot.querySelector("form")['new'].focus();
+ }
};
customElements.define('do-resetpw-create', ResetPasswordCreate);
@@ -622,6 +639,10 @@ class SettingsChangePassword extends HTMLElement {
alert("password changed");
});
}
+
+ connectedCallback() {
+ this.querySelector("form")['old'].focus();
+ }
};
customElements.define('do-settings-chpw', SettingsChangePassword);