History

Don't open menu on hover

Closes #603.

Thibaut Courouble committed 9 years ago

Commit 7b20d6d1 parent 1dbbb882 files · +8 −15Browse files

Unified · Split

2 files
  1. assets/javascripts/views/layout/menu.coffee +2 −4
  2. assets/stylesheets/components/_header.scss +6 −11
assets/javascripts/views/layout/menu.coffee+2−4
@@ -9,10 +9,8 @@ class app.views.Menu extends app.View · 8 unmodified lines
99 $.on document.body, 'click', @onGlobalClick
1010 return
1111
12− onClick: =>
13− prev = @el.previousElementSibling
14− $.remove @el
15− @delay (=> $.after prev, @el), 200
12+ onClick: (event) ->
13+ event.target.blur() if event.target.tagName is 'A'
1614 return
1715
1816 onGlobalClick: (event) =>
assets/stylesheets/components/_header.scss+6−11
@@ -74,28 +74,23 @@ · 73 unmodified lines
7474 border: 1px solid $headerBorder;
7575 border-radius: 3px;
7676 box-shadow: -1px 1px 1px rgba(black, .05);
77− transition: all 250ms cubic-bezier(0.23, 1, 0.32, 1);
77+ transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
7878 opacity: 0;
7979 -webkit-transform: scale(0, 0);
8080 transform: scale(0, 0);
8181 -webkit-transform-origin: 100% 0;
8282 transform-origin: 100% 0;
8383
84− &:hover,
85− ._menu-btn:hover + & {
86− transition-delay: 100ms;
87− }
88−
89− &:hover,
90− &.active,
91− ._menu-btn:hover + &,
92− ._menu-btn:focus + & {
84+ &.active {
85+ transition-duration: 250ms;
9386 opacity: 1;
9487 -webkit-transform: scale(1, 1);
9588 transform: scale(1, 1);
9689 }
9790
98− &:focus-within {
91+ &:focus-within,
92+ ._menu-btn:focus + & {
93+ transition-duration: 250ms;
9994 opacity: 1;
10095 -webkit-transform: scale(1, 1);
10196 transform: scale(1, 1);