Only show the spinner for clicked button (HRDlog)

pull/2411/head
phl0 2023-08-15 22:30:58 +02:00
rodzic 724e2cb7e5
commit 4d01d80624
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -46,7 +46,7 @@
echo '<td id ="modcount'.$station->station_id.'">' . $station->modcount . '</td>';
echo '<td id ="notcount'.$station->station_id.'">' . $station->notcount . '</td>';
echo '<td id ="totcount'.$station->station_id.'">' . $station->totcount . '</td>';
echo '<td><button id="HrdlogUpload" type="button" name="HrdlogUpload" class="btn btn-primary btn-sm ld-ext-right" onclick="ExportHrd('. $station->station_id .')"><i class="fas fa-cloud-upload-alt"></i> Upload<div class="ld ld-ring ld-spin"></div></button></td>';
echo '<td><button id="HrdlogUpload" type="button" name="HrdlogUpload" class="btn btn-primary btn-sm ld-ext-right ld-ext-right-'.$station->station_id.'" onclick="ExportHrd('. $station->station_id .')"><i class="fas fa-cloud-upload-alt"></i> Upload<div class="ld ld-ring ld-spin"></div></button></td>';
echo '</tr>';
}
echo '</tfoot></table>';

Wyświetl plik

@ -17,16 +17,16 @@ function ExportHrd(station_id) {
if ($(".errormessages").length > 0) {
$(".errormessages").remove();
}
$(".ld-ext-right").addClass('running');
$(".ld-ext-right").prop('disabled', true);
$(".ld-ext-right-"+station_id).addClass('running');
$(".ld-ext-right-"+station_id).prop('disabled', true);
$.ajax({
url: base_url + 'index.php/hrdlog/upload_station',
type: 'post',
data: {'station_id': station_id},
success: function (data) {
$(".ld-ext-right").removeClass('running');
$(".ld-ext-right").prop('disabled', false);
$(".ld-ext-right-"+station_id).removeClass('running');
$(".ld-ext-right-"+station_id).prop('disabled', false);
if (data.status == 'OK') {
$.each(data.info, function(index, value){
$('#modcount'+value.station_id).html(value.modcount);