fix(qr-modal): remove redundant rotate button and isolate background scroll and interactions (v3.8.47)

This commit is contained in:
2026-10-28 12:31:37 -03:00
parent 2d1fefa856
commit e84a236d54
8 changed files with 100 additions and 23 deletions
+17
View File
@@ -37,6 +37,17 @@
overflow-x: hidden;
position: relative;
}
html.modal-open,
body.modal-open {
overflow: hidden !important;
height: 100% !important;
touch-action: none;
overscroll-behavior: none;
}
.modal-backdrop.show {
z-index: 1075 !important;
opacity: 0.65 !important;
}
body {
font-family: 'Inter', sans-serif;
min-height: 100vh;
@@ -2235,6 +2246,12 @@
if (mobileBackdrop) mobileBackdrop.classList.remove("show");
document.body.style.overflow = "";
}
window.closeMobileSidebar = closeMobileSidebar;
// Al abrir cualquier modal (ej: QR, confirmaciones), replegar el menú móvil inmediatamente
document.addEventListener("show.bs.modal", function() {
closeMobileSidebar();
});
if (mobileBtn) {
mobileBtn.addEventListener("click", function(e) {
+61 -12
View File
@@ -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();
});
}