Files
2026-09-01 10:46:29 -03:00

49 lines
1.6 KiB
JavaScript
Executable File

/**
* SysCMS - Content Management System
*
* Copyright (c) 2025 Marco Costa
* All rights reserved.
*
* Author: Marco Costa
* Email: contato@syspanel.com.br
* Project: SysCMS
*
* This software is licensed, not sold.
* Permission is granted to use this software
* subject to the terms of the SysCMS Commercial License.
*
* Redistribution, sublicensing, resale, or
* disclosure of this software, in whole or in part,
* is strictly prohibited without prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
*/
document.addEventListener('DOMContentLoaded', function() {
// Auto-hide sidebar on mobile
const sidebarToggle = document.getElementById('sidebarToggle');
const layoutSidenav = document.getElementById('layoutSidenav');
const content = document.getElementById('layoutSidenav_content');
if (sidebarToggle && layoutSidenav && content) {
sidebarToggle.addEventListener('click', function() {
layoutSidenav.classList.toggle('sb-sidenav-toggled');
// Adjust content margin on mobile
if (window.innerWidth < 768) {
content.style.marginLeft = '0';
} else {
content.style.marginLeft = '250px';
}
});
}
// Handle window resize
window.addEventListener('resize', function() {
if (window.innerWidth < 768) {
content.style.marginLeft = '0';
} else {
content.style.marginLeft = '250px';
}
});
});