Merge pull request #2407 from phl0/qrzRunOneClassOnly

Only show the spinner for clicked button
这个提交包含在:
Andreas Kristiansen 2023-08-15 17:53:50 +02:00 提交者 GitHub
当前提交 724e2cb7e5
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 2 个文件被更改,包括 5 次插入5 次删除

查看文件

@ -45,7 +45,7 @@
echo '<td id ="modcount'.$station->station_id.'">' . $station->modcount . '</td>'; echo '<td id ="modcount'.$station->station_id.'">' . $station->modcount . '</td>';
echo '<td id ="notcount'.$station->station_id.'">' . $station->notcount . '</td>'; echo '<td id ="notcount'.$station->station_id.'">' . $station->notcount . '</td>';
echo '<td id ="totcount'.$station->station_id.'">' . $station->totcount . '</td>'; echo '<td id ="totcount'.$station->station_id.'">' . $station->totcount . '</td>';
echo '<td><button id="qrzUpload" type="button" name="qrzUpload" class="btn btn-primary btn-sm ld-ext-right" onclick="ExportQrz('. $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="qrzUpload" type="button" name="qrzUpload" class="btn btn-primary btn-sm ld-ext-right ld-ext-right-'.$station->station_id.'" onclick="ExportQrz('. $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 '</tr>';
} }
echo '</tfoot></table>'; echo '</tfoot></table>';

查看文件

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