Add wait cursor during ajax

This commit is contained in:
2023-05-29 22:37:05 +02:00
parent 007c419979
commit 1b362f2110
3 changed files with 33 additions and 15 deletions

View File

@@ -25,6 +25,9 @@
padding: 0.25rem 0.5rem; padding: 0.25rem 0.5rem;
font-size: 0.75rem; font-size: 0.75rem;
} }
.ajaxLoading {
cursor: progress !important;
}
</style> </style>
{% else %} {% else %}
<link <link
@@ -39,6 +42,9 @@
.tag { .tag {
cursor: pointer; cursor: pointer;
} }
.ajaxLoading {
cursor: progress !important;
}
</style> </style>
{% endif %} {% endif %}
<link <link

View File

@@ -8,6 +8,12 @@ $(document).ready(function () {
$(this).addClass('{{ selected }}'); $(this).addClass('{{ selected }}');
} }
}); });
$(document).ajaxStart(function(){
$("body").addClass('ajaxLoading');
});
$(document).ajaxStop(function(){
$("body").removeClass('ajaxLoading');
});
}); });
function excelFile() { function excelFile() {
var selectedFiles = ["{{ file }}"]; var selectedFiles = ["{{ file }}"];

View File

@@ -23,6 +23,12 @@ $(document).ready(function () {
$(this).addClass('{{ selected }}'); $(this).addClass('{{ selected }}');
} }
}); });
$(document).ajaxStart(function(){
$("body").addClass('ajaxLoading');
});
$(document).ajaxStop(function(){
$("body").removeClass('ajaxLoading');
});
}); });
function showFile(selectedFile) { function showFile(selectedFile) {
var form = $('<form action="/show" method="post">' + var form = $('<form action="/show" method="post">' +