From 11947ebec48b5f83388db920c5da49082430469c Mon Sep 17 00:00:00 2001 From: Jim Carlton Date: Fri, 18 Oct 2024 10:33:34 +1100 Subject: [PATCH] Removes condition for active nav links --- src/docs/docs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/docs/docs.js b/src/docs/docs.js index bfec74884..e778be706 100644 --- a/src/docs/docs.js +++ b/src/docs/docs.js @@ -50,11 +50,11 @@ function initDocs() { const navLinks = document.querySelectorAll('.nsw-docs__nav a') let currentURL = window.location.pathname - if (currentURL === '/' || currentURL === 'https://designsystem.digital.nsw.gov.au') currentURL = '/home/index.html' + if (currentURL === '/') currentURL = '/home/index.html' navLinks.forEach((link) => { - let linkURL = link.getAttribute('href') - if (linkURL == '/' || linkURL == 'https://designsystem.digital.nsw.gov.au') linkURL = '/home/index.html' + let linkURL = link.getAttribute('href').replace('https://designsystem.digital.nsw.gov.au', '') + if (linkURL == '/') linkURL = '/home/index.html' if (currentURL.match(linkURL)) { link.classList.add('current')