fix(qr-modal): remove redundant rotate button and isolate background scroll and interactions (v3.8.47)
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
<style>
|
||||
/* Asegurar aislamiento modal total e impedir scroll o clics detrás */
|
||||
#userQrCredentialModal {
|
||||
z-index: 1080 !important;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
.modal-backdrop.show {
|
||||
z-index: 1075 !important;
|
||||
opacity: 0.65 !important;
|
||||
}
|
||||
html.modal-open,
|
||||
body.modal-open {
|
||||
overflow: hidden !important;
|
||||
height: 100% !important;
|
||||
touch-action: none;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Modal Global de Credencial Digital QR del Usuario (UniCABA) -->
|
||||
<div class="modal fade" id="userQrCredentialModal" tabindex="-1" aria-labelledby="userQrCredentialModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="userQrCredentialModal" tabindex="-1" aria-labelledby="userQrCredentialModalLabel" aria-hidden="true" data-bs-backdrop="true" data-bs-keyboard="true">
|
||||
<div class="modal-dialog modal-dialog-centered" style="max-width: 440px;">
|
||||
<div class="modal-content border-0 shadow-lg overflow-hidden" style="border-radius: 18px;">
|
||||
<!-- Encabezado con estética de Carnet Universitario -->
|
||||
@@ -78,16 +97,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Botones de Acción -->
|
||||
<div class="d-grid gap-2">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm py-2" onclick="refreshGlobalQrModal()" id="btnRefreshGlobalQr">
|
||||
<i class="bi bi-arrow-clockwise me-1" id="globalRefreshQrIcon"></i>Rotar Ahora
|
||||
</button>
|
||||
<a href="/credential/my-card" class="btn btn-primary btn-sm py-2">
|
||||
<i class="bi bi-person-badge me-1"></i>Ver Carnet Completo
|
||||
</a>
|
||||
</div>
|
||||
<!-- Botón de Acción -->
|
||||
<div class="d-grid">
|
||||
<a href="/credential/my-card" class="btn btn-primary py-2 rounded-3 shadow-xs d-flex align-items-center justify-content-center">
|
||||
<i class="bi bi-person-badge me-2"></i>Ver Carnet Completo
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -243,10 +257,45 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var modalEl = document.getElementById('userQrCredentialModal');
|
||||
if (modalEl) {
|
||||
// Impedir que eventos de scroll de rueda o táctiles se propaguen a la página de fondo
|
||||
modalEl.addEventListener('wheel', function(e) {
|
||||
if (e.target === modalEl) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}, { passive: false });
|
||||
|
||||
modalEl.addEventListener('touchmove', function(e) {
|
||||
if (e.target === modalEl) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}, { passive: false });
|
||||
|
||||
modalEl.addEventListener('show.bs.modal', function() {
|
||||
// Bloqueo total de scroll en el elemento raíz (html) y cuerpo (body)
|
||||
document.documentElement.classList.add('modal-open');
|
||||
document.body.classList.add('modal-open');
|
||||
document.documentElement.style.overflow = 'hidden';
|
||||
document.body.style.overflow = 'hidden';
|
||||
|
||||
// Si el sidebar móvil estuviera desplegado, cerrarlo para evitar solapamientos
|
||||
if (typeof window.closeMobileSidebar === 'function') {
|
||||
window.closeMobileSidebar();
|
||||
} else {
|
||||
var sb = document.querySelector('.sidebar.mobile-open');
|
||||
if (sb) sb.classList.remove('mobile-open');
|
||||
var bd = document.getElementById('sidebarBackdrop');
|
||||
if (bd) bd.classList.remove('show');
|
||||
}
|
||||
|
||||
startAutoRefreshLoop();
|
||||
});
|
||||
modalEl.addEventListener('hide.bs.modal', function() {
|
||||
|
||||
modalEl.addEventListener('hidden.bs.modal', function() {
|
||||
// Restaurar scroll de página
|
||||
document.documentElement.classList.remove('modal-open');
|
||||
document.body.classList.remove('modal-open');
|
||||
document.documentElement.style.overflow = '';
|
||||
document.body.style.overflow = '';
|
||||
stopAutoRefreshLoop();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user