diff --git a/static/js/stream_create.js b/static/js/stream_create.js index bf3332b1c3..3283e9c8e8 100644 --- a/static/js/stream_create.js +++ b/static/js/stream_create.js @@ -90,6 +90,7 @@ function ajaxSubscribeForCreation(stream_name, description, principals, invite_o $("#create_stream_name").val(""); $("#create_stream_description").val(""); $("#subscriptions-status").hide(); + loading.destroy_indicator($('#stream_creating_indicator')); // The rest of the work is done via the subscribe event we will get }, error: function (xhr) { @@ -104,6 +105,7 @@ function ajaxSubscribeForCreation(stream_name, description, principals, invite_o // TODO: This next line does nothing. See #4647. ui_report.error(i18n.t("Error creating stream"), xhr, $("#subscriptions-status"), 'subscriptions-status'); + loading.destroy_indicator($('#stream_creating_indicator')); }, }); } @@ -158,6 +160,8 @@ function create_stream() { var announce = (!!page_params.notifications_stream && $('#announce-new-stream input').prop('checked')); + loading.make_indicator($('#stream_creating_indicator'), {text: i18n.t('Creating stream...')}); + ajaxSubscribeForCreation(stream_name, description, principals, diff --git a/static/styles/subscriptions.css b/static/styles/subscriptions.css index f71da79116..6d95ce4d98 100644 --- a/static/styles/subscriptions.css +++ b/static/styles/subscriptions.css @@ -768,6 +768,21 @@ form#add_new_subscription { margin: 0px; } +#stream_creation_form #stream_creating_indicator:not(:empty) { + position: absolute; + width: 100% !important; + height: calc(100% - 105px) !important; + display: flex !important; + justify-content: center; + align-items: center; + background: hsla(0, 0%, 100%, 0.9); + z-index: 1; +} + +#stream_creation_form #stream_creating_indicator .loading_indicator_text { + font-weight: 400; +} + #subscription_overlay .inner-box { margin: 20px; } diff --git a/static/templates/subscription_creation_form.handlebars b/static/templates/subscription_creation_form.handlebars index bc3fc1b1c7..c61c812cfe 100644 --- a/static/templates/subscription_creation_form.handlebars +++ b/static/templates/subscription_creation_form.handlebars @@ -1,6 +1,7 @@