diff --git a/static/js/nav.js b/static/js/nav.js index 59bc0d7..df4b013 100644 --- a/static/js/nav.js +++ b/static/js/nav.js @@ -41,7 +41,16 @@ function syncThemeBtn(theme) { if (!themeBtn) return; var light = theme === 'light'; - themeBtn.textContent = light ? '🌙 Mode sombre' : '☀️ Mode clair'; + /* Bouton dans la section Administration (#55) : icône et + libellé sont des séparés ; l'ancien bouton de + l'en-tête, lui, n'avait qu'un texte. */ + var ico = themeBtn.querySelector('[data-theme-ico]'); + var lbl = themeBtn.querySelector('[data-theme-label]'); + if (ico) ico.textContent = light ? '🌙' : '☀️'; + if (lbl) lbl.textContent = light ? 'Mode sombre' : 'Mode clair'; + if (!ico && !lbl) { + themeBtn.textContent = light ? '🌙 Mode sombre' : '☀️ Mode clair'; + } themeBtn.setAttribute('aria-pressed', light ? 'true' : 'false'); } if (themeBtn) {