diff --git a/static/js/theme.js b/static/js/theme.js index 39af3aa..ab539a4 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -11,22 +11,20 @@ function applyCollapsed(collapsed) { sidebar.classList.toggle('collapsed', collapsed); contentWrapper.classList.toggle('sidebar-collapsed', collapsed); - const icon = toggleBtn && toggleBtn.querySelector('i'); - if (icon) { - icon.className = collapsed ? 'fas fa-chevron-right' : 'fas fa-chevron-left'; - } } // Restore saved state instantly — suppress transitions so there's no // collapse animation flash on every page navigation. sidebar.style.transition = 'none'; contentWrapper.style.transition = 'none'; + if (toggleBtn) toggleBtn.style.transition = 'none'; applyCollapsed(localStorage.getItem(COLLAPSED_KEY) === '1'); // Re-enable transitions after one frame so the toggle button still animates. requestAnimationFrame(function () { requestAnimationFrame(function () { sidebar.style.transition = ''; contentWrapper.style.transition = ''; + if (toggleBtn) toggleBtn.style.transition = ''; }); });