goto selected menu item when scrolling with mousewheel on chest and clicking on it
This commit is contained in:
parent
3205bb6dc1
commit
b16c8a91e6
@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import '../app.css';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
let navPaths = [
|
||||
{
|
||||
@ -78,7 +79,14 @@
|
||||
? 'btn btn-square relative w-16 h-16'
|
||||
: 'btn btn-square group/menu-button relative w-16 h-16'}
|
||||
on:click={() => {
|
||||
if (!isTouch) showMenuPermanent = !showMenuPermanent;
|
||||
if (!isTouch) {
|
||||
let activePath = navPaths.find((path) => path.active);
|
||||
if (activePath !== undefined) {
|
||||
goto(activePath.href);
|
||||
} else {
|
||||
showMenuPermanent = !showMenuPermanent;
|
||||
}
|
||||
}
|
||||
}}
|
||||
on:touchend={() => {
|
||||
isTouch = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user