Skip to content
Snippets Groups Projects
Commit 149de5b1 authored by syuilo's avatar syuilo
Browse files

Improve navigation

parent d47d6bb1
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@ if (localStorage.getItem('kyoppie') === 'yuppie') {
location.reload(true);
}
window.history.scrollRestoration = 'manual';
if (localStorage.getItem('theme') == null) {
applyTheme(lightTheme);
}
......
......@@ -52,10 +52,13 @@ export const router = new VueRouter({
],
// なんかバギー
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition;
} else {
return { x: 0, y: 0 };
}
setTimeout(() => {
if (savedPosition) {
window.scroll({ top: savedPosition.y, behavior: 'instant' });
} else {
window.scroll({ top: 0, behavior: 'instant' });
}
}, 1000);
return;
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment