From 2824f75cd5e3862290829e2a399d3ab754da47b4 Mon Sep 17 00:00:00 2001 From: Enoc Date: Tue, 2 Mar 2021 20:49:38 -0600 Subject: [PATCH] Fix sidebar when the mouse leave the window --- assets/javascripts/views/sidebar/sidebar.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/views/sidebar/sidebar.coffee b/assets/javascripts/views/sidebar/sidebar.coffee index f3ae3bd4..3dce0fc1 100644 --- a/assets/javascripts/views/sidebar/sidebar.coffee +++ b/assets/javascripts/views/sidebar/sidebar.coffee @@ -28,10 +28,14 @@ class app.views.Sidebar extends app.View app.on 'ready', @onReady - $.on document.documentElement, 'mouseleave', (event) => @display() unless event.clientX <= 0 + $.on document.documentElement, 'mouseleave', => @hide() $.on document.documentElement, 'mouseenter', => @resetDisplay(forceNoHover: false) return + hide: -> + @removeClass 'show' + return + display: -> @addClass 'show' return