fixed mobile
This commit is contained in:
@@ -21,10 +21,10 @@
|
||||
</head>
|
||||
|
||||
<body class="min-h-screen bg-white text-zinc-950 antialiased dark:bg-zinc-950 dark:text-zinc-100">
|
||||
<div class="wms-app-shell" data-wms-shell>
|
||||
<div class="wms-mobile-overlay" data-wms-mobile-close></div>
|
||||
<div class="wms-app-shell" data-wms-shell data-wms-mobile-shell>
|
||||
<button type="button" class="wms-mobile-overlay" data-wms-mobile-close aria-label="<?php echo e(__('Close navigation menu')); ?>"></button>
|
||||
|
||||
<aside class="wms-sidebar" data-wms-sidebar aria-label="<?php echo e(__('Main navigation')); ?>">
|
||||
<aside id="wms-main-sidebar" class="wms-sidebar" data-wms-sidebar aria-label="<?php echo e(__('Main navigation')); ?>">
|
||||
<div class="wms-sidebar-header">
|
||||
<a href="<?php echo e(auth()->user()?->isMpbaPlatformAdmin() && Route::has('platform.dashboard') ? route('platform.dashboard') : route('dashboard')); ?>" wire:navigate class="wms-brand" aria-label="<?php echo e(__('Warehouse Management System')); ?>">
|
||||
<span class="wms-brand-mark" data-wms-brand-toggle title="<?php echo e(__('Expand sidebar')); ?>"><span class="wms-brand-mark-inner">W</span></span>
|
||||
@@ -50,7 +50,6 @@
|
||||
<i class="fa-solid fa-screwdriver-wrench wms-sidebar-icon" aria-hidden="true"></i>
|
||||
<span data-wms-sidebar-label><?php echo e(__('Platform')); ?></span>
|
||||
</a>
|
||||
|
||||
<?php elseif(Route::has('dashboard')): ?>
|
||||
<a href="<?php echo e(route('dashboard')); ?>" wire:navigate class="wms-sidebar-link <?php if(request()->routeIs('dashboard')): ?> is-active <?php endif; ?>" title="<?php echo e(__('Dashboard')); ?>">
|
||||
<i class="fa-solid fa-gauge-high wms-sidebar-icon" aria-hidden="true"></i>
|
||||
@@ -328,6 +327,19 @@
|
||||
</aside>
|
||||
|
||||
<div class="wms-main-panel">
|
||||
<header class="wms-mobile-header" role="banner">
|
||||
<button type="button" class="wms-mobile-menu" data-wms-mobile-open aria-label="<?php echo e(__('Open navigation menu')); ?>" aria-controls="wms-main-sidebar" aria-expanded="false">
|
||||
<i class="fa-solid fa-bars" aria-hidden="true"></i>
|
||||
</button>
|
||||
|
||||
<a href="<?php echo e(auth()->user()?->isMpbaPlatformAdmin() && Route::has('platform.dashboard') ? route('platform.dashboard') : route('dashboard')); ?>" wire:navigate class="wms-mobile-title">
|
||||
<?php echo e(__('Warehouse Management System')); ?>
|
||||
|
||||
</a>
|
||||
|
||||
<span class="wms-mobile-badge">MPBA</span>
|
||||
</header>
|
||||
|
||||
<main class="wms-content">
|
||||
<?php echo e($slot); ?>
|
||||
|
||||
@@ -412,8 +424,32 @@
|
||||
});
|
||||
}
|
||||
|
||||
function closeMobileSidebar() { document.documentElement.dataset.wmsMobileSidebar = 'closed'; }
|
||||
function openMobileSidebar() { document.documentElement.dataset.wmsMobileSidebar = 'open'; }
|
||||
function setMobileToggleState(isOpen) {
|
||||
document.querySelectorAll('[data-wms-mobile-open]').forEach((button) => {
|
||||
button.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
||||
});
|
||||
|
||||
document.body.classList.toggle('wms-mobile-nav-open', isOpen);
|
||||
}
|
||||
|
||||
function closeMobileSidebar() {
|
||||
document.documentElement.dataset.wmsMobileSidebar = 'closed';
|
||||
setMobileToggleState(false);
|
||||
}
|
||||
|
||||
function openMobileSidebar() {
|
||||
document.documentElement.dataset.wmsMobileSidebar = 'open';
|
||||
setMobileToggleState(true);
|
||||
}
|
||||
|
||||
function toggleMobileSidebar() {
|
||||
if (document.documentElement.dataset.wmsMobileSidebar === 'open') {
|
||||
closeMobileSidebar();
|
||||
return;
|
||||
}
|
||||
|
||||
openMobileSidebar();
|
||||
}
|
||||
|
||||
function bindSidebarControls() {
|
||||
applySidebarState();
|
||||
@@ -441,10 +477,15 @@
|
||||
applySidebarState();
|
||||
});
|
||||
});
|
||||
closeMobileSidebar();
|
||||
|
||||
document.querySelectorAll('[data-wms-mobile-open]').forEach((button) => {
|
||||
if (button.dataset.wmsBound === '1') return;
|
||||
button.dataset.wmsBound = '1';
|
||||
button.addEventListener('click', openMobileSidebar);
|
||||
button.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
toggleMobileSidebar();
|
||||
});
|
||||
});
|
||||
document.querySelectorAll('[data-wms-mobile-close]').forEach((button) => {
|
||||
if (button.dataset.wmsBound === '1') return;
|
||||
|
||||
Reference in New Issue
Block a user