zeus.ugent.be/content/assets/scripts/search.coffee

17 lines
636 B
CoffeeScript
Raw Normal View History

2018-06-26 10:55:36 +02:00
input_field = document.getElementById('tipue_search_input_field')
input = document.getElementById('tipue_search_input')
2016-10-08 19:18:37 +02:00
2018-06-26 10:55:36 +02:00
input_field.addEventListener 'focusin', ->
input.classList.add('focused')
2016-10-31 17:51:52 +01:00
2018-06-26 10:55:36 +02:00
input_field.addEventListener 'focusout', ->
input.classList.remove('focused')
burger = document.getElementsByClassName('navbar-burger')[0]
menu = document.getElementsByClassName('navbar-menu')[0]
burger.addEventListener 'click', ->
s = 'is-active'
if menu.classList.contains(s) then menu.classList.remove(s) else menu.classList.add(s)
if burger.classList.contains(s) then burger.classList.remove(s) else burger.classList.add(s)