 
     # Close nav menu if open
     close_nav: ->
-      if @$(".navbar-collapse.in").length > 0 || @$("li.open").length > 0
-        @$(".navbar-collapse").collapse("hide")
-        @$("li.open").removeClass("open")
+      @$(".navbar-collapse.in").length > 0 && @$(".navbar-collapse").collapse("hide")
+      @$("li.open").length > 0 && @$("li.open").removeClass("open")
 
     impersonate: (user_id) ->
       return if !@true_user.can("impersonate_users")

      ".tab.inventory a": "inventory"

      # monitoring
      ".tab.monitoring.primary a":         "monitoring_overview"
      ".tab.monitoring a.overview":        "monitoring_overview"
      ".tab.monitoring a.check_templates": "mon_check_templates"
      ".tab.monitoring a.schedules":       "mon_oncalls"

      # runbooks
      ".tab.runbooks.primary a":            "runbooks"
      ".tab.runbooks a.run":                "runbooks"
      ".tab.runbooks a.scheduled_commands": "scheduled_commands"
      ".tab.runbooks a.logs":               "runbooks_logs"


      "click a": (e) ->
        # hide the navbar-toggle on click (only visible on xs or sm screens)
        if @$(".navbar-collapse.in").length > 0
          @close_nav()

      "click a#logout": (e) ->
        $.ajax "/logout",
