From c6dd932a0b755a63e72d00942ea1ba1fa6669506 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 7 Nov 2020 12:30:16 +0900 Subject: [PATCH] Improve usability --- src/client/components/ui/a.vue | 6 +++++- src/client/ui/_common_/header.vue | 6 +++--- src/client/ui/default.vue | 7 ++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/components/ui/a.vue b/src/client/components/ui/a.vue index 384ee0259e..f6c66257b3 100644 --- a/src/client/components/ui/a.vue +++ b/src/client/components/ui/a.vue @@ -121,7 +121,11 @@ export default defineComponent({ return this.window(); } - this.$router.push(this.to); + if (this.$router.currentRoute.value.path === this.to) { + window.scroll({ top: 0, behavior: 'smooth' }); + } else { + this.$router.push(this.to); + } } } } diff --git a/src/client/ui/_common_/header.vue b/src/client/ui/_common_/header.vue index 13f6420aa8..af7f1c2b6a 100644 --- a/src/client/ui/_common_/header.vue +++ b/src/client/ui/_common_/header.vue @@ -1,12 +1,12 @@ diff --git a/src/client/ui/default.vue b/src/client/ui/default.vue index 0073a0c8c0..7065b345fd 100644 --- a/src/client/ui/default.vue +++ b/src/client/ui/default.vue @@ -3,7 +3,7 @@
-
+
@@ -211,6 +211,10 @@ export default defineComponent({ if (window._scroll) window._scroll(); }, + onHeaderClick() { + window.scroll({ top: 0, behavior: 'smooth' }); + }, + onContextmenu(e) { const path = this.$route.path; os.contextMenu([{ @@ -292,6 +296,7 @@ export default defineComponent({ backdrop-filter: blur(32px); background-color: var(--header); border-bottom: solid 1px var(--divider); + user-select: none; } > main {