diff --git a/Bootstrap_new/js/ux-manager.js b/Bootstrap_new/js/ux-manager.js index e746ecb..5a6c9e5 100644 --- a/Bootstrap_new/js/ux-manager.js +++ b/Bootstrap_new/js/ux-manager.js @@ -239,24 +239,36 @@ class NavigationManager { * @private - Méthode de configuration initiale */ setupActiveMenu() { - // Récupérer la configuration de la page active const activeParentId = window.appConfig?.activeParentId; const activeLink = window.appConfig?.activeLink; - console.log('[Navigation] Page active:', activeLink, 'Parent ID:', activeParentId); + console.log('[Navigation] Configuration:', { activeParentId, activeLink }); - if (activeParentId !== null && activeParentId !== '') { - this.activeMenuId = `submenu${activeParentId}`; - console.log('[Navigation] Menu actif configuré:', this.activeMenuId); + // CORRECTION : Si "Accueil" mais activeParentId != 0, corriger + if (activeLink === 'Accueil' && activeParentId !== '0') { + console.warn('[Navigation] Correction: Accueil devrait être menu 0, pas', activeParentId); + this.activeMenuId = 'submenu0'; - // Ouvrir seulement le menu actif (avec délai pour le DOM) + // Mettre à jour la config + if (window.appConfig) { + window.appConfig.activeParentId = '0'; + } + } + // Cas normal + else if (activeParentId !== null && activeParentId !== '') { + this.activeMenuId = `submenu${activeParentId}`; + } else { + this.activeMenuId = null; + } + + console.log('[Navigation] Menu actif final:', this.activeMenuId); + + // Appliquer + if (this.activeMenuId) { setTimeout(() => { this.openMenu(this.activeMenuId); this.currentOpenMenu = this.activeMenuId; }, 100); - } else { - console.log('[Navigation] Aucun menu actif détecté'); - this.closeAllMenus(); } } diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 7cb32c1..ae85dbc 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -374,9 +374,9 @@ console.groupEnd(); + + class="nav-link ">