summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Okhrimenko <vokhrimenko@mirantis.com>2014-10-10 17:31:33 +0300
committerMatthias Runge <mrunge@redhat.com>2015-09-23 12:27:40 +0200
commit853f0ec7aaec474454d2f4153d4a8ffb06347d04 (patch)
treea31530b3ac15e66608c719700267f66888842deb
parent8ed76248967ca741226dcebec1aa780e678fcf23 (diff)
downloadhorizon-853f0ec7aaec474454d2f4153d4a8ffb06347d04.tar.gz
Fix inability to switch region via Switch Region dropdown
Remove class 'hide' that prevented modal login form from showing. Add "spinner" before page reload, after submit form. Related commit: https://review.openstack.org/#/c/130157/ Related-Bug: #1381413 (cherry picked from commit dbf5fe0a2005c546a2f89353fd217405335370f7) Change-Id: Ib81fc148e1c2c70df2b41309ce83d80a3a28d038
-rw-r--r--horizon/static/horizon/js/horizon.modals.js9
-rw-r--r--horizon/templates/auth/_login.html2
-rw-r--r--openstack_dashboard/static/dashboard/scss/horizon.scss4
3 files changed, 11 insertions, 4 deletions
diff --git a/horizon/static/horizon/js/horizon.modals.js b/horizon/static/horizon/js/horizon.modals.js
index 6f6be8101..12f441669 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 59a5dfc14..17f37efe8 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 a078ff237..159b7a2e3 100644
--- a/openstack_dashboard/static/dashboard/scss/horizon.scss
+++ b/openstack_dashboard/static/dashboard/scss/horizon.scss
@@ -639,6 +639,10 @@ form label {
display: inline-block;
}
+.login.modal .modal-dialog {
+ width: 390px;
+}
+
.modal.fullscreen .modal-dialog {
width: 90%;
margin: auto;