Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

registration: Show spinner and disable button while processing.

sahil839d37ddf13a42d
diff --git a/static/js/portico/signup.js b/static/js/portico/signup.js
index 9a85d26892a..e88fcc22560 100644
--- a/static/js/portico/signup.js
+++ b/static/js/portico/signup.js
@@ -103,6 +103,14 @@ $(() => {
$("#timezone").val(new Intl.DateTimeFormat().resolvedOptions().timeZone);
}
+ $("#registration").on("submit", () => {
+ if ($("#registration").valid()) {
+ $(".register-button .loader").css("display", "inline-block");
+ $(".register-button").prop("disabled", true);
+ $(".register-button span").hide();
+ }
+ });
+
// Code in this block will be executed when the /accounts/send_confirm
// endpoint is visited i.e. accounts_send_confirm.html is rendered.
if ($("[data-page-id='accounts-send-confirm']").length > 0) {
diff --git a/static/styles/portico/portico_signin.css b/static/styles/portico/portico_signin.css
index a5d0ba114bd..c0b8ab2e757 100644
--- a/static/styles/portico/portico_signin.css
+++ b/static/styles/portico/portico_signin.css
@@ -804,6 +804,15 @@ button#register_auth_button_gitlab {
border-radius: 4px;
}
+ .register-button .loader {
+ display: none;
+ vertical-align: top;
+ position: relative;
+ height: 30px;
+ margin-top: -10px;
+ top: 5px;
+ }
+
#id_team_subdomain.subdomain {
margin-top: 0;
text-align: right;
diff --git a/templates/zerver/register.html b/templates/zerver/register.html
index 44dc0470c28..bcb3b6ad040 100644
--- a/templates/zerver/register.html
+++ b/templates/zerver/register.html
@@ -236,7 +236,10 @@ Form is validated both client-side using jquery-validate (see signup.js) and ser
</div>
{% endif %}
<div class="register-button-box">
- <button class="register-button" type="submit">{{ _('Sign up') }}</button>
+ <button class="register-button" type="submit">
+ <span>{{ _('Sign up') }}</span>
+ <object class="loader" type="image/svg+xml" data="/static/images/loader.svg"></object>
+ </button>
<input type="hidden" name="next" value="{{ next }}" />
</div>
</div>