BattleSim/client/app/js/concerns/toggle_navigation.coffee

10 lines
363 B
CoffeeScript
Raw Normal View History

2016-02-01 22:19:30 +00:00
# Used to handle the show navigation button in the header, which is visible when the browser
# window becomes small enough.
$ ->
$navigation = $("#navigation")
$(".show-navigation").click =>
active = $navigation.hasClass('active')
$navigation.toggleClass('active', !active)
$navigation.on 'click', '.nav_item', -> $navigation.removeClass("active")