From 24ff9449a06c94c42f778f9c5d46a7c6e9accd57 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Fri, 26 Feb 2021 18:09:07 +0100 Subject: Keep thumbnail of opened concerts highlighted --- "actualit\303\251s.html" | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actualités.html') diff --git "a/actualit\303\251s.html" "b/actualit\303\251s.html" index 99d54ae..606bb74 100644 --- "a/actualit\303\251s.html" +++ "b/actualit\303\251s.html" @@ -73,6 +73,8 @@ var anchor = document.location.hash; if (anchor.match(/#concert-/)) { document.querySelector(anchor).classList.add('active'); + document.querySelector(`a[href="${document.location.hash}"]`) + .classList.add('active'); } document.querySelectorAll('a.event').forEach((link) => { link.addEventListener('click', function(click) { @@ -84,6 +86,12 @@ prev.classList.remove('active'); var id = link.attributes['href'].value; document.querySelector(id).classList.add('active'); + + prev = document.querySelector('a.event.active'); + if (prev) { + prev.classList.remove('active'); + } + link.classList.add('active'); }); }); -- cgit v1.2.3