ソースを参照

Don't open menu on hover

Closes #603.
Thibaut Courouble 8 年 前
コミット
7b20d6d02e

+ 2 - 4
assets/javascripts/views/layout/menu.coffee

@@ -9,10 +9,8 @@ class app.views.Menu extends app.View
     $.on document.body, 'click', @onGlobalClick
     return
 
-  onClick: =>
-    prev = @el.previousElementSibling
-    $.remove @el
-    @delay (=> $.after prev, @el), 200
+  onClick: (event) ->
+    event.target.blur() if event.target.tagName is 'A'
     return
 
   onGlobalClick: (event) =>

+ 6 - 11
assets/stylesheets/components/_header.scss

@@ -74,28 +74,23 @@
   border: 1px solid $headerBorder;
   border-radius: 3px;
   box-shadow: -1px 1px 1px rgba(black, .05);
-  transition: all 250ms cubic-bezier(0.23, 1, 0.32, 1);
+  transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
   opacity: 0;
   -webkit-transform: scale(0, 0);
           transform: scale(0, 0);
   -webkit-transform-origin: 100% 0;
           transform-origin: 100% 0;
 
-  &:hover,
-  ._menu-btn:hover + & {
-    transition-delay: 100ms;
-  }
-
-  &:hover,
-  &.active,
-  ._menu-btn:hover + &,
-  ._menu-btn:focus + & {
+  &.active {
+    transition-duration: 250ms;
     opacity: 1;
     -webkit-transform: scale(1, 1);
             transform: scale(1, 1);
   }
 
-  &:focus-within {
+  &:focus-within,
+  ._menu-btn:focus + & {
+    transition-duration: 250ms;
     opacity: 1;
     -webkit-transform: scale(1, 1);
             transform: scale(1, 1);