lazy load modal parts and matrici cron
This commit is contained in:
@@ -712,7 +712,7 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php include 'modal_parts.php'; ?>
|
||||
<div id="partsModalContainer"></div>
|
||||
<?php include 'photos_functions.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1181,6 +1181,40 @@ foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Lazy loading per il modal delle parti
|
||||
$(document).on('click', '.parts-btn', function() {
|
||||
const iddatadb = $(this).data('iddatadb');
|
||||
$.ajax({
|
||||
url: 'modal_parts.php',
|
||||
method: 'GET',
|
||||
data: {
|
||||
iddatadb: iddatadb
|
||||
},
|
||||
success: function(response) {
|
||||
$('#partsModalContainer').html(response);
|
||||
$('#partsModal').modal('show');
|
||||
// Carica i dati delle parti, se necessario
|
||||
if (typeof loadParts === 'function') {
|
||||
loadParts(iddatadb);
|
||||
}
|
||||
// Gestisci il backdrop
|
||||
$('.modal-backdrop').remove(); // Rimuovi backdrop precedenti
|
||||
$('body').addClass('modal-open').append('<div class="modal-backdrop fade show"></div>');
|
||||
},
|
||||
error: function() {
|
||||
alert('Errore nel caricamento del modal delle parti.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Pulizia del DOM quando il modal delle parti viene chiuso
|
||||
$(document).on('hidden.bs.modal', '#partsModal', function() {
|
||||
$('#partsModalContainer').empty();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- Modale di conferma per l'esportazione -->
|
||||
<div class="modal fade" id="exportConfirmModal" tabindex="-1" aria-labelledby="exportConfirmModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
|
||||
Reference in New Issue
Block a user