159 lines
5.7 KiB
PHP
Executable File
159 lines
5.7 KiB
PHP
Executable File
</main>
|
|
</div>
|
|
<!-- /#page-content-wrapper -->
|
|
</div>
|
|
<!-- /#wrapper -->
|
|
|
|
<!-- Scripts -->
|
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
|
</main>
|
|
</div>
|
|
<!-- /#page-content-wrapper -->
|
|
</div>
|
|
<!-- /#wrapper -->
|
|
|
|
<!-- Scripts -->
|
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
|
<script src="<?php echo asset('js/summernote-bs5.min.js'); ?>" defer></script>
|
|
<script src="<?php echo asset('js/main.js'); ?>" defer></script>
|
|
|
|
<!-- Script para el menú desplegable -->
|
|
<script>
|
|
// Función para inicializar el menú
|
|
function initMenu() {
|
|
const menuToggle = document.getElementById('menu-toggle');
|
|
const wrapper = document.getElementById('wrapper');
|
|
const sidebar = document.getElementById('sidebar-wrapper');
|
|
const overlay = document.querySelector('.overlay');
|
|
let isMobile = window.innerWidth <= 768;
|
|
let isTransitioning = false;
|
|
|
|
// Función para abrir el menú
|
|
function openMenu() {
|
|
if (isTransitioning || !wrapper || !overlay) return;
|
|
|
|
isTransitioning = true;
|
|
wrapper.classList.add('toggled');
|
|
overlay.classList.add('show'); // Usar la clase 'show'
|
|
isTransitioning = false;
|
|
}
|
|
|
|
// Función para cerrar el menú
|
|
function closeMenu() {
|
|
if (isTransitioning || !wrapper || !overlay) return;
|
|
|
|
isTransitioning = true;
|
|
overlay.classList.remove('show'); // Usar la clase 'show'
|
|
|
|
// Esperar a que termine la transición antes de ocultar
|
|
const onTransitionEnd = () => {
|
|
if (!overlay.classList.contains('show')) { // Verificar si la clase 'show' ya no está
|
|
wrapper.classList.remove('toggled');
|
|
overlay.removeEventListener('transitionend', onTransitionEnd);
|
|
isTransitioning = false;
|
|
}
|
|
};
|
|
|
|
overlay.addEventListener('transitionend', onTransitionEnd, { once: true });
|
|
}
|
|
|
|
// Función para alternar el menú
|
|
function toggleMenu() {
|
|
if (wrapper.classList.contains('toggled')) {
|
|
closeMenu();
|
|
} else {
|
|
openMenu();
|
|
}
|
|
}
|
|
|
|
// Evento para el botón de menú
|
|
if (menuToggle) {
|
|
menuToggle.addEventListener('click', function(e) {
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
toggleMenu();
|
|
});
|
|
}
|
|
|
|
// Cerrar el menú al hacer clic en el overlay
|
|
if (overlay) {
|
|
overlay.addEventListener('click', function(e) {
|
|
e.stopPropagation();
|
|
closeMenu();
|
|
});
|
|
}
|
|
|
|
// Cerrar el menú al hacer clic en un enlace en pantallas pequeñas
|
|
const navLinks = document.querySelectorAll('.list-group-item');
|
|
navLinks.forEach(function(link) {
|
|
link.addEventListener('click', function() {
|
|
if (window.innerWidth <= 768) {
|
|
toggleMenu();
|
|
}
|
|
});
|
|
});
|
|
|
|
// Ajustar el menú al cambiar el tamaño de la ventana
|
|
function handleResize() {
|
|
if (isTransitioning) return;
|
|
|
|
const newIsMobile = window.innerWidth <= 768;
|
|
|
|
if (newIsMobile !== isMobile) {
|
|
isMobile = newIsMobile;
|
|
|
|
if (!isMobile) {
|
|
// En pantallas grandes, asegurarse de que el menú esté visible
|
|
if (wrapper) wrapper.classList.remove('toggled');
|
|
if (overlay) {
|
|
overlay.classList.remove('show'); // Usar la clase 'show'
|
|
}
|
|
}
|
|
} else {
|
|
// En móviles, asegurarse de que el menú esté cerrado al inicio
|
|
if (wrapper) wrapper.classList.remove('toggled');
|
|
if (overlay) {
|
|
overlay.classList.remove('show'); // Usar la clase 'show'
|
|
}
|
|
}
|
|
}
|
|
|
|
// Manejar el evento de redimensionamiento
|
|
window.addEventListener('resize', handleResize);
|
|
|
|
// Inicializar el estado del menú
|
|
handleResize();
|
|
}
|
|
|
|
// Inicializar el menú cuando el DOM esté listo
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', initMenu);
|
|
} else {
|
|
initMenu();
|
|
}
|
|
|
|
// Manejar el evento de carga completa para asegurar que todo esté listo
|
|
window.addEventListener('load', function() {
|
|
// Asegurarse de que el menú se inicialice correctamente
|
|
if (typeof initMenu === 'function') {
|
|
initMenu();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script src="/assets/js/translate_frontend.js"></script>
|
|
|
|
<!-- Script para eliminar el Debug Language List -->
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const debugList = document.getElementById('debug-language-list');
|
|
if (debugList) {
|
|
debugList.remove();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html> |