Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes circular link issue reported by devin gray #14965

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions pages/_includes/statewide-footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,55 @@
document
.querySelector('.js-cagov-current-year')
.innerHTML = new Date().getFullYear();
//Start Circular Links Removal - by Mukhtar
// Get the current pathname

var currentPathname = window.location.pathname;



// Find the div element with the class 'wp-block-query'

var queryDiv = document.querySelector('.wp-block-query');



if (queryDiv) {

// Find all the 'li' elements within the 'div'

var listItems = queryDiv.querySelectorAll('li');



// Loop through the 'li' elements

listItems.forEach(function (li) {

var link = li.querySelector('a'); // Assuming 'a' elements contain the href

if (link) {

var href = link.getAttribute('href');



// Check if the href matches the current pathname

if (href.includes(currentPathname)) {

// Remove the 'li' element if the href matches

li.parentNode.removeChild(li);

}

}

});

}
//End Circular Links Removal
</script>&nbsp;{{ 'State of California' | i18n(locale) }}
</p>
</div>
Expand Down
Loading