132 lines
4.0 KiB
PHP
Executable File
132 lines
4.0 KiB
PHP
Executable File
<!-- Legacy NetGescon assets (UI classica) -->
|
|
@include('components.google-analytics')
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@7.4.47/css/materialdesignicons.min.css">
|
|
<link rel="stylesheet" href="{{ asset('css/netgescon-admin.css') }}">
|
|
<style>
|
|
.fi-sidebar-group-btn,
|
|
.fi-sidebar-group-dropdown-trigger-btn {
|
|
min-height: auto !important;
|
|
padding-block: calc(var(--spacing) * 0.55) !important;
|
|
}
|
|
|
|
.fi-sidebar-group-label {
|
|
line-height: 1.2 !important;
|
|
}
|
|
|
|
.fi-sidebar-item-button,
|
|
.fi-sidebar-item a {
|
|
min-height: auto !important;
|
|
padding-block: calc(var(--spacing) * 0.45) !important;
|
|
}
|
|
|
|
.fi-sidebar-nav-groups > li,
|
|
.fi-sidebar-group,
|
|
.fi-sidebar-item {
|
|
margin-block: 0 !important;
|
|
}
|
|
|
|
@media (max-width: 63.998rem), (hover: none) and (pointer: coarse) {
|
|
.fi-body.fi-body-has-navigation .fi-topbar,
|
|
.fi-body.fi-body-has-navigation .fi-main,
|
|
.fi-body.fi-body-has-navigation .fi-main-ctn {
|
|
width: 100% !important;
|
|
max-width: 100% !important;
|
|
margin-left: 0 !important;
|
|
padding-left: 0 !important;
|
|
}
|
|
|
|
.fi-body.fi-body-has-navigation .fi-main-ctn {
|
|
padding-top: 0 !important;
|
|
overflow-x: visible !important;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
(function() {
|
|
let isNavigating = false;
|
|
let isRestoring = false;
|
|
|
|
const getSidebar = () => {
|
|
return document.querySelector('.fi-sidebar-nav') ||
|
|
document.querySelector('aside nav') ||
|
|
document.querySelector('.fi-sidebar') ||
|
|
document.querySelector('.fi-sidebar-nav-groups');
|
|
};
|
|
|
|
const handleScroll = (e) => {
|
|
if (isNavigating || isRestoring) {
|
|
return;
|
|
}
|
|
const scrollTop = e.currentTarget.scrollTop;
|
|
localStorage.setItem('fi-sidebar-scroll-top', scrollTop);
|
|
};
|
|
|
|
const restoreScroll = () => {
|
|
const sidebar = getSidebar();
|
|
if (!sidebar) return;
|
|
|
|
const savedScroll = localStorage.getItem('fi-sidebar-scroll-top');
|
|
if (savedScroll !== null) {
|
|
const scrollTopVal = parseInt(savedScroll, 10);
|
|
if (scrollTopVal <= 0) return;
|
|
|
|
isRestoring = true;
|
|
|
|
let attempts = 0;
|
|
const maxAttempts = 10;
|
|
|
|
const applyScroll = () => {
|
|
const sb = getSidebar();
|
|
if (!sb) return;
|
|
sb.scrollTop = scrollTopVal;
|
|
attempts++;
|
|
if (attempts < maxAttempts) {
|
|
requestAnimationFrame(applyScroll);
|
|
} else {
|
|
setTimeout(() => {
|
|
isRestoring = false;
|
|
}, 100);
|
|
}
|
|
};
|
|
|
|
applyScroll();
|
|
}
|
|
};
|
|
|
|
const setupScrollListener = () => {
|
|
const sidebar = getSidebar();
|
|
if (!sidebar) return;
|
|
|
|
sidebar.removeEventListener('scroll', handleScroll);
|
|
sidebar.addEventListener('scroll', handleScroll, { passive: true });
|
|
};
|
|
|
|
const init = () => {
|
|
isNavigating = false;
|
|
restoreScroll();
|
|
setupScrollListener();
|
|
};
|
|
|
|
document.addEventListener('DOMContentLoaded', init);
|
|
|
|
document.addEventListener('livewire:navigating', () => {
|
|
isNavigating = true;
|
|
});
|
|
document.addEventListener('livewire:navigated', init);
|
|
document.addEventListener('livewire:load', init);
|
|
|
|
window.addEventListener('beforeunload', () => {
|
|
isNavigating = true;
|
|
});
|
|
window.addEventListener('pagehide', () => {
|
|
isNavigating = true;
|
|
});
|
|
|
|
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
init();
|
|
}
|
|
})();
|
|
</script>
|