mirror of
https://github.com/retspen/webvirtcloud
synced 2026-07-02 09:35:42 +00:00
Make login button spinner more robust by using Bootstrap's attribute
This commit is contained in:
parent
1b2da68b28
commit
1388472a56
2 changed files with 12 additions and 30 deletions
|
|
@ -39,19 +39,10 @@
|
||||||
|
|
||||||
{% block script %}
|
{% block script %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
document.getElementById('form-signin').addEventListener('submit', function() {
|
||||||
$("#btn-signin").click(function() {
|
var btn = document.getElementById('btn-signin');
|
||||||
// disable button
|
btn.disabled = true;
|
||||||
$(this).prop("disabled", true);
|
btn.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> {% trans "Loading" %}...';
|
||||||
// add spinner to button
|
|
||||||
$(this).html(
|
|
||||||
`
|
|
||||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
||||||
{% trans "Loading" %}...
|
|
||||||
`
|
|
||||||
);
|
|
||||||
$("#form-signin").submit();
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock script%}
|
{% endblock script %}
|
||||||
|
|
|
||||||
|
|
@ -37,19 +37,10 @@
|
||||||
|
|
||||||
{% block script %}
|
{% block script %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
document.getElementById('form-signin').addEventListener('submit', function() {
|
||||||
$("#btn-signin").click(function() {
|
var btn = document.getElementById('btn-signin');
|
||||||
// disable button
|
btn.disabled = true;
|
||||||
$(this).prop("disabled", true);
|
btn.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> {% trans "Loading" %}...';
|
||||||
// add spinner to button
|
|
||||||
$(this).html(
|
|
||||||
`
|
|
||||||
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
||||||
{% trans "Loading" %}...
|
|
||||||
`
|
|
||||||
);
|
|
||||||
$("#form-signin").submit();
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock script%}
|
{% endblock script %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue