mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 02:32:57 +00:00
47 lines
1.8 KiB
JavaScript
47 lines
1.8 KiB
JavaScript
// Quick debug to check if AdminScrollManager is working
|
|
// Run this in browser console
|
|
|
|
(function debugAdminScrollManager() {
|
|
console.clear();
|
|
console.log('=== DEBUGGING AdminScrollManager ===\n');
|
|
|
|
// Check if AdminScrollManager is loaded
|
|
console.log('🔍 Checking AdminScrollManager...');
|
|
|
|
// Look for AdminScrollManager logs
|
|
console.log('📋 Recent console logs:');
|
|
const logs = console.logs || [];
|
|
console.log(' - Look for "[AdminScrollManager] Component mounted" message');
|
|
console.log(' - Look for "[AdminScrollManager] Saved position" message');
|
|
console.log(' - Look for "[AdminScrollManager] Restoring position" message');
|
|
|
|
// Check if AdminLayout is being used
|
|
const adminLayout = document.querySelector('.admin-layout');
|
|
console.log('\n🏗️ AdminLayout check:');
|
|
console.log(' AdminLayout element found:', !!adminLayout);
|
|
|
|
// Check sidebar
|
|
const sidebar = document.querySelector('[data-sidebar="true"]');
|
|
console.log('\n📱 Sidebar check:');
|
|
console.log(' Sidebar element found:', !!sidebar);
|
|
console.log(' Sidebar current scroll:', sidebar?.scrollTop);
|
|
|
|
// Check if React DevTools shows AdminScrollManager
|
|
console.log('\n🔧 Manual test:');
|
|
console.log(' 1. Scroll the sidebar to any position');
|
|
console.log(' 2. Click an admin navigation link');
|
|
console.log(' 3. Watch console for AdminScrollManager messages');
|
|
|
|
console.log('\n💡 If you don\'t see AdminScrollManager logs, the component is not loading');
|
|
|
|
// Force a test
|
|
if (sidebar) {
|
|
console.log('\n🧪 Forcing a scroll test...');
|
|
sidebar.scrollTop = 300;
|
|
setTimeout(() => {
|
|
console.log(' Scroll set to:', sidebar.scrollTop);
|
|
console.log(' Now click a navigation link and watch for AdminScrollManager logs');
|
|
}, 100);
|
|
}
|
|
})();
|