Collapses navbar on click if not in wrong mode