fix: video sidebar highlight needed two clicks (music chrome wiped it)
setActivePageChrome cleared .active from EVERY .nav-button — including the video sidebar's — but only re-highlighted music buttons ([data-page]). On the first video nav it ran (via navigateToPage) and wiped the video selection right after the video side set it; the second click hit navigateToPage's same-page early-return so it didn't run, which is why the highlight only 'stuck' on the second click. Scope the clear to .nav-button[data-page] (music nav only). The video side owns its own .nav-button[data-video-page] highlight via setActiveNav. Zero music-side impact (all music nav buttons carry data-page).
This commit is contained in:
parent
9b1d76b4ff
commit
958a5cd0a4
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,11 @@ function showLegacyPage(pageId) {
|
|||
}
|
||||
|
||||
function setActivePageChrome(pageId) {
|
||||
document.querySelectorAll('.nav-button').forEach(btn => {
|
||||
// Only manage MUSIC nav buttons (they carry data-page). The video sidebar owns
|
||||
// its own highlight via .nav-button[data-video-page]; clearing those here wiped
|
||||
// the video selection on the first nav — it only re-stuck on a second click,
|
||||
// which hits navigateToPage's same-page early-return so this never ran. (#sidebar)
|
||||
document.querySelectorAll('.nav-button[data-page]').forEach(btn => {
|
||||
btn.classList.remove('active');
|
||||
btn.removeAttribute('aria-current');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue