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