Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1x 1x 1x 1x 1x | import { getSiblings } from '../lib/get-siblings-of-element'
export const init = (menuItemClass: string, overrideMenuClass: string) => {
const menuItems = document.querySelectorAll(`[class^=${menuItemClass}]`)
console.log('TCL: init -> menuItems', menuItems)
menuItems.forEach((menuItem: HTMLElement) => {
const parent = menuItem.parentElement
const siblings = getSiblings(parent)
const respectiveDropdown = siblings.find((el: HTMLElement) => {
return el.className === overrideMenuClass
})
respectiveDropdown.style.display = 'none'
})
}
|