applySidebar() {
        if(this.dynamicSidebars) {
            this.dynamicSidebars.forEach((sidebar) => {

                this.endpoints.children = sidebar.getAttribute('endpoint-children');
                this.addTriggers(sidebar.querySelectorAll('.c-sidebar__toggle'));  

                sidebar.querySelectorAll('.c-sidebar__subcontainer').forEach((subContainer) => {
                    if(subContainer.childElementCount === 0) {
                        subContainer.parentElement.removeChild(subContainer);
                    }
                });
            });
        }
    }
/**
     * Finds all sidebars and applies appropriate classes and attributes on load
     * @return {void}
     */
Finds all sidebars and applies appropriate classes and attributes on load
@return {void}
Finds all sidebars and applies appropriate classes and attributes on load @return { void }
applySidebar() {
        if(this.dynamicSidebars) {
            this.dynamicSidebars.forEach((sidebar) => {
                this.endpoints.children = sidebar.getAttribute('endpoint-children');
                this.addTriggers(sidebar.querySelectorAll('.c-sidebar__toggle'));  
                sidebar.querySelectorAll('.c-sidebar__subcontainer').forEach((subContainer) => {
                    if(subContainer.childElementCount === 0) {
                        subContainer.parentElement.removeChild(subContainer);
                    }
                });
            });
        }
    }
applySidebar ( ) { if ( this . dynamicSidebars ) { this . dynamicSidebars . forEach ( ( sidebar ) => { this . endpoints . children = sidebar . getAttribute ( 'endpoint-children' ) ; this . addTriggers ( sidebar . querySelectorAll ( '.c-sidebar__toggle' ) ) ; sidebar . querySelectorAll ( '.c-sidebar__subcontainer' ) . forEach ( ( subContainer ) => { if ( subContainer . childElementCount === 0 ) { subContainer . parentElement . removeChild ( subContainer ) ; } } ) ; } ) ; } }
Finds all sidebars and applies appropriate classes and attributes on load
 @return {void}
Finds all sidebars and applies appropriate classes and attributes on load @return { void }