mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
chore: allow scroll to top on nav side
This commit is contained in:
parent
f3a8778ede
commit
db2140e350
2 changed files with 5 additions and 4 deletions
|
@ -51,7 +51,7 @@ const noUserVisual = computed(() => isHydrated.value && props.userOnly && !curre
|
|||
:active-class="activeClass"
|
||||
group focus:outline-none disabled:pointer-events-none
|
||||
:tabindex="noUserDisable ? -1 : null"
|
||||
@click="$scrollToTop"
|
||||
@click="$trackScroll.forceScrollToTop()"
|
||||
>
|
||||
<CommonTooltip :disabled="!isMediumOrLargeScreen" :content="text" placement="right">
|
||||
<div
|
||||
|
|
|
@ -28,18 +28,19 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|||
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
if (path !== route.fullPath) {
|
||||
const fullPath = route.fullPath
|
||||
if (path !== fullPath) {
|
||||
reject(new Error('navigation canceled'))
|
||||
return
|
||||
}
|
||||
|
||||
const r = ignoreCustomRoutes ? undefined : customRoutes.has(route.fullPath)
|
||||
const r = ignoreCustomRoutes ? undefined : customRoutes.has(fullPath)
|
||||
if (r) {
|
||||
reject(new Error('custom routed detected'))
|
||||
return
|
||||
}
|
||||
|
||||
const scrollPosition = storage.value[route.fullPath]
|
||||
const scrollPosition = storage.value[fullPath]
|
||||
if (scrollPosition)
|
||||
window.scrollTo(0, scrollPosition)
|
||||
|
||||
|
|
Loading…
Reference in a new issue