     else
       @translate @mainMenu, "X", "-110%", "0ms"
 
-      window.setTimeout =>
+      setTimeout =>
         @translate @mainMenu, "X", "0%", "0.3s"
       , 10
 

    @currentPage = @targetPage
    @isTransitioning = false

    window.setTimeout =>
      if @transitionAnimation
        switch transitionType
          when "slide"

  # Returns nothing.
  slideOutMenu: ->
    if @menuOpen
      setTimeout =>
        @translate @mainMenu, "X", "-110%", "0.3s"
      , 10

      setTimeout =>
        @mainMenu.style.display = "none"
      , 300

