summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-11-07 12:30:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-11-07 12:30:16 +0900
commitc6dd932a0b755a63e72d00942ea1ba1fa6669506 (patch)
tree5ee49b6676d2dd5f5e57fa58e76dbf903b164835 /src/client
parent絵文字ピッカーの検索に絵文字をペーストしたとき確定... (diff)
downloadmisskey-c6dd932a0b755a63e72d00942ea1ba1fa6669506.tar.gz
misskey-c6dd932a0b755a63e72d00942ea1ba1fa6669506.tar.bz2
misskey-c6dd932a0b755a63e72d00942ea1ba1fa6669506.zip
Improve usability
Diffstat (limited to 'src/client')
-rw-r--r--src/client/components/ui/a.vue6
-rw-r--r--src/client/ui/_common_/header.vue6
-rw-r--r--src/client/ui/default.vue7
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 @@
<template>
<div class="fdidabkb">
<transition :name="$store.state.device.animation ? 'header' : ''" mode="out-in" appear>
- <button class="_button back" v-if="withBack && canBack" @click="back()"><Fa :icon="faChevronLeft"/></button>
+ <button class="_button back" v-if="withBack && canBack" @click.stop="back()"><Fa :icon="faChevronLeft"/></button>
</transition>
<template v-if="info">
<div class="titleContainer">
<template v-if="info.tabs">
- <div class="title" v-for="tab in info.tabs" :key="tab.id" :class="{ _button: tab.onClick, selected: tab.selected }" @click="tab.onClick" v-tooltip="tab.tooltip">
+ <div class="title" v-for="tab in info.tabs" :key="tab.id" :class="{ _button: tab.onClick, selected: tab.selected }" @click.stop="tab.onClick" v-tooltip="tab.tooltip">
<Fa v-if="tab.icon" :icon="tab.icon" :key="tab.icon" class="icon"/>
<span v-if="tab.title" class="text">{{ tab.title }}</span>
</div>
@@ -20,7 +20,7 @@
</div>
</template>
</div>
- <button class="_button action" v-if="info.action" @click="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button>
+ <button class="_button action" v-if="info.action" @click.stop="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button>
</template>
</div>
</template>
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 @@
<XSidebar ref="nav" class="sidebar"/>
<div class="contents" ref="contents" :class="{ wallpaper }">
- <header class="header" ref="header" @contextmenu.prevent.stop="onContextmenu">
+ <header class="header" ref="header" @contextmenu.prevent.stop="onContextmenu" @click="onHeaderClick">
<XHeader :info="pageInfo"/>
</header>
<main ref="main">
@@ -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 {