Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
466 B
2
Indexable
Never
    findAll('.side-menu__item').forEach(menuItem => {
      const input = menuItem.querySelector('.side-menu__input')

      let isTouching = false
      on(menuItem, 'pointerdown', event => isTouching = event.pointerType != 'mouse')
      on(input, 'focus', _ => {
        if (isTouching && hasClass('body', 'side-menu_collapse'))
          addClass(menuItem, 'side-menu__open')
      })
      on(input, 'blur', _ => removeClass(menuItem, 'side-menu__open'))
    })