Untitled

mail@pastecode.io avatar
unknown
jsx
2 years ago
715 B
2
Indexable
Never
const showSubMenuHandler = (event) => {
    let chevron = event.currentTarget.childNodes[0] || event.target;
    let ulSubMenu = event.currentTarget.parentNode.parentNode.childNodes[1].classList.contains('h-0') ? event.currentTarget.parentNode.parentNode.childNodes[1] : event.currentTarget.parentNode.childNodes[1].classList.contains('h-0') ? event.currentTarget.parentNode.childNodes[1] : '';
    chevron.classList.toggle('!rotate-180');
    event.currentTarget.parentNode.parentNode.classList.contains('level-1') && event.currentTarget.classList.toggle('!bg-[#F8F8F8]');
    event.currentTarget.classList.toggle('rounded-lg');
    ulSubMenu.classList.toggle('!h-auto');
    ulSubMenu.classList.toggle('!py-1');
}