summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);