buildDOM(item) {
        const uniqID = Math.random().toString(36).substr(2, 9);

        const newLink = document.createElement("a");
        newLink.href = item.href

        const newEl = document.createElement("div");
        newEl.className = "c-navbar__item";

        // Build link element
        const newSpan = document.createElement("span");
        newSpan.appendChild(document.createTextNode(item.name))
        
        newEl.appendChild(newSpan);

        if (item.list) {
            // Item has children
            // Build toggle elements
            const newTgl = document.createElement("div");
            newTgl.className = "c-navbar__toggle";

            const newBtn = document.createElement("button");
            newBtn.className = "c-button c-button__icon";

            newBtn.setAttribute('js-menu-trigger', 'c-navbar__subitem--expanded');
            newBtn.setAttribute('js-menu-dart', uniqID);
            newBtn.setAttribute('data-load-submenu', item.id);

            const newLbl = document.createElement("span");
            newLbl.className = "c-btn__label";

            const newIcon = document.createElement("i");
            newIcon.className = "c-icon c-icon--color-primary c-icon--size-md material-icons";
            newIcon.appendChild(document.createTextNode("expand_more"))

            // Append Icon elemetns
            newLbl.appendChild(newIcon);
            newBtn.appendChild(newLbl);
            newTgl.appendChild(newBtn);

            // Append element
            newEl.appendChild(newTgl);

            const newSubItem = document.createElement("div");
            newSubItem.className = "c-navbar__subitem"
            newSubItem.setAttribute('js-menu-target', uniqID);
            newSubItem.setAttribute('data-append-submenu', item.id);

            newEl.appendChild(newSubItem);
        }

        newLink.appendChild(newEl)

        this.elm = newLink;
    }
/**
     * Builds a nav item dom object 
     * 
     * @param {*} item The item data to build the element based on
     */
Builds a nav item dom object

@param {*} item The item data to build the element based on
Builds a nav item dom object @param { * } item The item data to build the element based on
buildDOM(item) {
        const uniqID = Math.random().toString(36).substr(2, 9);
        const newLink = document.createElement("a");
        newLink.href = item.href
        const newEl = document.createElement("div");
        newEl.className = "c-navbar__item";
        const newSpan = document.createElement("span");
        newSpan.appendChild(document.createTextNode(item.name))
        newEl.appendChild(newSpan);
        if (item.list) {
            const newTgl = document.createElement("div");
            newTgl.className = "c-navbar__toggle";
            const newBtn = document.createElement("button");
            newBtn.className = "c-button c-button__icon";
            newBtn.setAttribute('js-menu-trigger', 'c-navbar__subitem--expanded');
            newBtn.setAttribute('js-menu-dart', uniqID);
            newBtn.setAttribute('data-load-submenu', item.id);
            const newLbl = document.createElement("span");
            newLbl.className = "c-btn__label";
            const newIcon = document.createElement("i");
            newIcon.className = "c-icon c-icon--color-primary c-icon--size-md material-icons";
            newIcon.appendChild(document.createTextNode("expand_more"))
            newLbl.appendChild(newIcon);
            newBtn.appendChild(newLbl);
            newTgl.appendChild(newBtn);
            newEl.appendChild(newTgl);
            const newSubItem = document.createElement("div");
            newSubItem.className = "c-navbar__subitem"
            newSubItem.setAttribute('js-menu-target', uniqID);
            newSubItem.setAttribute('data-append-submenu', item.id);
            newEl.appendChild(newSubItem);
        }
        newLink.appendChild(newEl)
        this.elm = newLink;
    }
buildDOM ( item ) { const uniqID = Math . random ( ) . toString ( 36 ) . substr ( 2 , 9 ) ; const newLink = document . createElement ( "a" ) ; newLink . href = item . href const newEl = document . createElement ( "div" ) ; newEl . className = "c-navbar__item" ; const newSpan = document . createElement ( "span" ) ; newSpan . appendChild ( document . createTextNode ( item . name ) ) newEl . appendChild ( newSpan ) ; if ( item . list ) { const newTgl = document . createElement ( "div" ) ; newTgl . className = "c-navbar__toggle" ; const newBtn = document . createElement ( "button" ) ; newBtn . className = "c-button c-button__icon" ; newBtn . setAttribute ( 'js-menu-trigger' , 'c-navbar__subitem--expanded' ) ; newBtn . setAttribute ( 'js-menu-dart' , uniqID ) ; newBtn . setAttribute ( 'data-load-submenu' , item . id ) ; const newLbl = document . createElement ( "span" ) ; newLbl . className = "c-btn__label" ; const newIcon = document . createElement ( "i" ) ; newIcon . className = "c-icon c-icon--color-primary c-icon--size-md material-icons" ; newIcon . appendChild ( document . createTextNode ( "expand_more" ) ) newLbl . appendChild ( newIcon ) ; newBtn . appendChild ( newLbl ) ; newTgl . appendChild ( newBtn ) ; newEl . appendChild ( newTgl ) ; const newSubItem = document . createElement ( "div" ) ; newSubItem . className = "c-navbar__subitem" newSubItem . setAttribute ( 'js-menu-target' , uniqID ) ; newSubItem . setAttribute ( 'data-append-submenu' , item . id ) ; newEl . appendChild ( newSubItem ) ; } newLink . appendChild ( newEl ) this . elm = newLink ; }
Builds a nav item dom object
Builds a nav item dom object
// Build link element // Item has children // Build toggle elements // Append Icon elemetns // Append element