     @debouncedRefresh()
 
 
-  onLeave: (e) =>
+  onMouseLeave: =>
+    @hideMenu()
+
+
+  hideMenu: =>
     @currentMenu = null
     @debouncedRefresh()
 

    currentTree


  onEnter: (e) =>
    e.stopPropagation()
    $link = $(e.currentTarget)
    @currentMenu = $link.attr('data-menu-target')

# along with osu!web.  If not, see <http://www.gnu.org/licenses/>.
###
class @Menu
  $menuLink: (id) -> $(".js-menu[data-menu-target#{if id then "='#{id}'" else ''}]")

  constructor: ->
    @debouncedRefresh = _.debounce @refresh, 150
    $(document).on 'touchstart', '.js-menu', @onTouchStart
    $(document).on 'mouseenter', '.js-menu', @onMouseEnter
    $(document).on 'mouseleave', '.js-menu', @onMouseLeave
    $(document).on 'click', @onGlobalClick


  parentMenuId: ($child) ->
