mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fixed bug in desktop navigation causing dropdown menu to get stuck until moused over again.
This commit is contained in:
@@ -35,22 +35,24 @@
|
||||
line-height: 1.71;
|
||||
color: $gray-50;
|
||||
cursor: pointer;
|
||||
background-color: $purple-200;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
|
||||
&:active, &:hover, &.active {
|
||||
background-color: rgba(#d5c8ff, 0.32);
|
||||
background-color: #6133B4;
|
||||
color: $purple-200;
|
||||
}
|
||||
|
||||
&.dropdown-inactive {
|
||||
cursor: default;
|
||||
|
||||
|
||||
&:active, &:hover, &.active {
|
||||
background-color: inherit;
|
||||
background-color: $purple-200;
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
@@ -97,4 +99,4 @@
|
||||
.dropdown-menu.show {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/inventory'),
|
||||
'down': $route.path.startsWith('/inventory') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/inventory')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@@ -102,8 +101,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/shop'),
|
||||
'down': $route.path.startsWith('/shop') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/shop')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@@ -169,8 +167,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/groups'),
|
||||
'down': $route.path.startsWith('/groups') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/groups')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@@ -212,8 +209,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/group-plans'),
|
||||
'down': $route.path.startsWith('/group-plans') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/group-plans')}"
|
||||
>
|
||||
<div
|
||||
v-if="groupPlans.length > 0"
|
||||
@@ -246,8 +242,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/challenges'),
|
||||
'down': $route.path.startsWith('/challenges') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/challenges')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@@ -283,8 +278,7 @@
|
||||
<li
|
||||
class="topbar-item droppable"
|
||||
:class="{
|
||||
'active': $route.path.startsWith('/help'),
|
||||
'down': $route.path.startsWith('/help') && isDesktop()}"
|
||||
'active': $route.path.startsWith('/help')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@@ -809,7 +803,11 @@ export default {
|
||||
},
|
||||
dropdownDesktop (hover) {
|
||||
if (this.isDesktop() && hover.target.classList.contains('droppable')) {
|
||||
this.dropdown(hover.target);
|
||||
if (hover.type === 'mouseenter') {
|
||||
this.openDropdown(hover.target);
|
||||
} else {
|
||||
this.closeDropdown(hover.target);
|
||||
}
|
||||
}
|
||||
},
|
||||
dropdownMobile (click) {
|
||||
@@ -827,6 +825,15 @@ export default {
|
||||
element.classList.toggle('down');
|
||||
element.lastChild.style.maxHeight = element.classList.contains('down') ? `${element.lastChild.scrollHeight}px` : 0;
|
||||
},
|
||||
closeDropdown (element) {
|
||||
element.classList.remove('down');
|
||||
element.lastChild.style.maxHeight = 0;
|
||||
},
|
||||
openDropdown (element) {
|
||||
element.classList.add('down');
|
||||
element.lastChild.style.maxHeight = `${element.lastChild.scrollHeight}px`;
|
||||
},
|
||||
|
||||
closeMenu () {
|
||||
if (this.isMobile()) {
|
||||
this.menuIsOpen = false;
|
||||
|
||||
Reference in New Issue
Block a user