[Bands] Added message saying that band has been saved.

This commit is contained in:
Andreas 2022-09-06 16:39:30 +02:00
parent 84af5b83c6
commit 0366431975
2 changed files with 7 additions and 2 deletions

View File

@ -64,7 +64,7 @@
<a href="javascript:deleteBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-danger btn-sm" ><i class="fas fa-trash-alt"></i> Delete</a>
</td>
<td>
<a href="javascript:saveBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-primary btn-sm" ><i class="fas fa-save"></i></i> Save</a>
<a href="javascript:saveBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-primary btn-sm ld-ext-right btnband_<?php echo $band->id ?>" ><i class="fas fa-save"></i></i> Save<div class="ld ld-ring ld-spin"></div></a>
</td>
</tr>

View File

@ -141,6 +141,8 @@ function deactivateAllBands() {
}
function saveBand(id) {
$(".btnband_"+id).addClass('running');
$(".btnband_"+id).prop('disabled', true);
$.ajax({
url: base_url + 'index.php/band/saveBand',
type: 'post',
@ -157,7 +159,10 @@ function saveBand(id) {
'vucc': $(".vucc_"+id+" input[type='checkbox']").is(":checked")
},
success: function (html) {
// Add an alert to say that it is saved. Vanish after 5 seconds.
$(".alert").remove();
$('.card-body').prepend('<div class="alert alert-success" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>'+$(".band_"+id).parent("tr:first").find("td:first").text()+' band has been saved!</div>');
$(".btnband_"+id).removeClass('running');
$(".btnband_"+id).prop('disabled', false);
}
});
}