Skip to content
Discussion options

You must be logged in to vote

This is probably a bit jank but whatever

document.addEventListener('DOMContentLoaded', function() {
    const desktopViewportBreakpoint = 1219;
    
    const itemsToExpand = ['categories'];

    function expandNavItems(itemsToExpand) {
        const navLabels = [...document.querySelectorAll('nav > ul > li > label')];

        for (const item of itemsToExpand) {
            const label = navLabels.find(l => l.children[0].textContent.trim() === item);
            const expands = label.nextElementSibling;

            if (label && expands && expands.getAttribute('aria-expanded') === 'false') {
                label.click();
            }
        }
    }

    function handleViewportChange() {

Replies: 4 comments 3 replies

Comment options

alexvoss
Mar 22, 2024
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@alexvoss
Comment options

alexvoss Mar 22, 2024
Collaborator Sponsor

@divSelector
Comment options

@alexvoss
Comment options

alexvoss Mar 22, 2024
Collaborator Sponsor

Comment options

You must be logged in to vote
0 replies
Answer selected by divSelector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants