diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-05 20:01:52 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-12-05 20:01:52 +0900 |
| commit | e804a299e068afcbfb2fe36cc429b9a502a7b2d9 (patch) | |
| tree | 2b49835df6ba29cf9a8827e4a4ffc4e47efbcf48 /packages/client/src/components | |
| parent | refactor(client): :sparkles: (diff) | |
| download | misskey-e804a299e068afcbfb2fe36cc429b9a502a7b2d9.tar.gz misskey-e804a299e068afcbfb2fe36cc429b9a502a7b2d9.tar.bz2 misskey-e804a299e068afcbfb2fe36cc429b9a502a7b2d9.zip | |
fix(client): better hover detection
Diffstat (limited to 'packages/client/src/components')
| -rw-r--r-- | packages/client/src/components/notification.vue | 8 | ||||
| -rw-r--r-- | packages/client/src/components/reactions-viewer.reaction.vue | 8 | ||||
| -rw-r--r-- | packages/client/src/components/renote-button.vue | 8 |
3 files changed, 3 insertions, 21 deletions
diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 15d36f5a64..37a88edc64 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -19,10 +19,6 @@ :reaction="notification.reaction ? notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : notification.reaction" :custom-emojis="notification.note.emojis" :no-style="true" - @touchstart.passive="onReactionMouseover" - @mouseover="onReactionMouseover" - @mouseleave="onReactionMouseleave" - @touchend="onReactionMouseleave" /> </div> </div> @@ -151,7 +147,7 @@ export default defineComponent({ os.api('users/groups/invitations/reject', { invitationId: props.notification.invitation.id }); }; - const { onMouseover: onReactionMouseover, onMouseleave: onReactionMouseleave } = useTooltip((showing) => { + useTooltip(reactionRef, (showing) => { os.popup(XReactionTooltip, { showing, reaction: props.notification.reaction ? props.notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : props.notification.reaction, @@ -170,8 +166,6 @@ export default defineComponent({ rejectFollowRequest, acceptGroupInvitation, rejectGroupInvitation, - onReactionMouseover, - onReactionMouseleave, elRef, reactionRef, }; diff --git a/packages/client/src/components/reactions-viewer.reaction.vue b/packages/client/src/components/reactions-viewer.reaction.vue index 44c6e98093..a1de99f018 100644 --- a/packages/client/src/components/reactions-viewer.reaction.vue +++ b/packages/client/src/components/reactions-viewer.reaction.vue @@ -6,10 +6,6 @@ class="hkzvhatu _button" :class="{ reacted: note.myReaction == reaction, canToggle }" @click="toggleReaction()" - @touchstart.passive="onMouseover" - @mouseover="onMouseover" - @mouseleave="onMouseleave" - @touchend="onMouseleave" > <XReactionIcon :reaction="reaction" :custom-emojis="note.emojis"/> <span>{{ count }}</span> @@ -90,7 +86,7 @@ export default defineComponent({ if (!props.isInitial) anime(); }); - const { onMouseover, onMouseleave } = useTooltip(async (showing) => { + useTooltip(buttonRef, async (showing) => { const reactions = await os.api('notes/reactions', { noteId: props.note.id, type: props.reaction, @@ -113,8 +109,6 @@ export default defineComponent({ buttonRef, canToggle, toggleReaction, - onMouseover, - onMouseleave, }; }, }); diff --git a/packages/client/src/components/renote-button.vue b/packages/client/src/components/renote-button.vue index 280283ec67..446686de10 100644 --- a/packages/client/src/components/renote-button.vue +++ b/packages/client/src/components/renote-button.vue @@ -3,10 +3,6 @@ ref="buttonRef" class="eddddedb _button canRenote" @click="renote()" - @touchstart.passive="onMouseover" - @mouseover="onMouseover" - @mouseleave="onMouseleave" - @touchend="onMouseleave" > <i class="fas fa-retweet"></i> <p v-if="count > 0" class="count">{{ count }}</p> @@ -42,7 +38,7 @@ export default defineComponent({ const canRenote = computed(() => ['public', 'home'].includes(props.note.visibility) || props.note.userId === $i.id); - const { onMouseover, onMouseleave } = useTooltip(async (showing) => { + useTooltip(buttonRef, async (showing) => { const renotes = await os.api('notes/renotes', { noteId: props.note.id, limit: 11 @@ -87,8 +83,6 @@ export default defineComponent({ buttonRef, canRenote, renote, - onMouseover, - onMouseleave, }; }, }); |