diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js index acba621538..c5e1d97756 100644 --- a/horizon/static/horizon/js/horizon.modals.js +++ b/horizon/static/horizon/js/horizon.modals.js @@ -228,8 +228,11 @@ horizon.addInitFunction(horizon.modals.init = function() { $('.ajax-modal, .dropdown-toggle').attr('disabled', true); horizon.modals.modal_spinner(gettext("Working")); }, - complete: function () { - horizon.modals.spinner.modal('hide'); + complete: function (jqXHR) { + var redirect_header = jqXHR.getResponseHeader("X-Horizon-Location"); + if (redirect_header === null) { + horizon.modals.spinner.modal('hide'); + } $("#modal_wrapper .modal").last().modal("show"); $button.prop("disabled", false); }, @@ -238,7 +241,7 @@ horizon.addInitFunction(horizon.modals.init = function() { add_to_field_header = jqXHR.getResponseHeader("X-Horizon-Add-To-Field"), json_data, field_to_update; if (redirect_header === null) { - $('.ajax-modal, .dropdown-toggle').removeAttr("disabled"); + $('.ajax-modal, .dropdown-toggle').removeAttr("disabled"); } $form.closest(".modal").modal("hide"); if (redirect_header) { diff --git a/horizon/templates/auth/_login.html b/horizon/templates/auth/_login.html index 59a5dfc144..17f37efe8a 100644 --- a/horizon/templates/auth/_login.html +++ b/horizon/templates/auth/_login.html @@ -3,7 +3,7 @@ {% load url from future %} {% block modal-header %}{% trans "Log In" %}{% endblock %} -{% block modal_class %}login {% if hide %}modal hide{% endif %}{% endblock %} +{% block modal_class %}login {% if hide %}modal{% endif %}{% endblock %} {% block form_action %}{% url 'login' %}{% endblock %} {% block ng_controller %}hzLoginCtrl{% endblock %} diff --git a/openstack_dashboard/static/dashboard/scss/horizon.scss b/openstack_dashboard/static/dashboard/scss/horizon.scss index 0afd8b0fc8..2f1cf4e485 100644 --- a/openstack_dashboard/static/dashboard/scss/horizon.scss +++ b/openstack_dashboard/static/dashboard/scss/horizon.scss @@ -635,6 +635,10 @@ form label { display: inline-block; } +.login.modal .modal-dialog { + width: 390px; +} + .modal.fullscreen .modal-dialog { width: 90%; margin: auto;