Added 'always-enabled' submit button selector
In case when we do not want to disable a form button after form submit, it can be marked as <input class="always-enabled">. Fixes bug 1011527 Change-Id: I176844a3c69cdf260cb40a6574ae34b6a36ee2a0
This commit is contained in:
parent
40e34c3000
commit
bd0bf100a2
@ -20,6 +20,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
{% block modal-footer %}
|
||||||
<input class="btn btn-primary pull-right" type="submit" value="{% trans "Download EC2 Credentials" %}" />
|
<input class="btn btn-primary pull-right always-enabled" type="submit" value="{% trans "Download EC2 Credentials" %}" />
|
||||||
{% if hide %}<a href="{% url horizon:settings:ec2:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
|
{% if hide %}<a href="{% url horizon:settings:ec2:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -27,6 +27,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block modal-footer %}
|
{% block modal-footer %}
|
||||||
<button class="btn btn-primary pull-right" type="submit">{% trans "Download RC File" %}</button>
|
<button class="btn btn-primary pull-right always-enabled" type="submit">{% trans "Download RC File" %}</button>
|
||||||
{% if hide %}<a href="{% url horizon:settings:project:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
|
{% if hide %}<a href="{% url horizon:settings:project:index %}" class="btn secondary cancel close">{% trans "Cancel" %}</a>{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -17,11 +17,14 @@ horizon.forms = {
|
|||||||
horizon.addInitFunction(function () {
|
horizon.addInitFunction(function () {
|
||||||
// Disable multiple submissions when launching a form.
|
// Disable multiple submissions when launching a form.
|
||||||
$("form").submit(function () {
|
$("form").submit(function () {
|
||||||
$(this).submit(function () {
|
var button = $(this).find('[type="submit"]');
|
||||||
|
if (button.length && !button.hasClass('always-enabled')){
|
||||||
|
$(this).submit(function () {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$('input:submit').removeClass('primary').addClass('disabled');
|
button.removeClass('primary').addClass('disabled');
|
||||||
$('input:submit').attr('disabled', 'disabled');
|
button.attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user