summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-01-08 14:28:14 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-01-08 14:28:14 +0900
commitdcca2350ddff11e3b5f0d38784b437504c055af1 (patch)
treeb16485679491fe60f527364eb4c3cb8e3611aea7 /packages
parentrefactor (diff)
downloadmisskey-dcca2350ddff11e3b5f0d38784b437504c055af1.tar.gz
misskey-dcca2350ddff11e3b5f0d38784b437504c055af1.tar.bz2
misskey-dcca2350ddff11e3b5f0d38784b437504c055af1.zip
:art:
Diffstat (limited to 'packages')
-rw-r--r--packages/frontend/src/components/MkReactionsViewer.reaction.vue14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/frontend/src/components/MkReactionsViewer.reaction.vue b/packages/frontend/src/components/MkReactionsViewer.reaction.vue
index 1d5c402765..321ce7ab2c 100644
--- a/packages/frontend/src/components/MkReactionsViewer.reaction.vue
+++ b/packages/frontend/src/components/MkReactionsViewer.reaction.vue
@@ -1,6 +1,6 @@
<template>
<button
- ref="buttonRef"
+ ref="buttonEl"
v-ripple="canToggle"
class="hkzvhatu _button"
:class="{ reacted: note.myReaction == reaction, canToggle }"
@@ -28,7 +28,7 @@ const props = defineProps<{
note: misskey.entities.Note;
}>();
-const buttonRef = shallowRef<HTMLElement>();
+const buttonEl = shallowRef<HTMLElement>();
const canToggle = computed(() => !props.reaction.match(/@\w/) && $i);
@@ -58,9 +58,9 @@ const toggleReaction = () => {
const anime = () => {
if (document.hidden) return;
- const rect = buttonRef.value.getBoundingClientRect();
- const x = rect.left + (buttonRef.value.offsetWidth / 2);
- const y = rect.top + (buttonRef.value.offsetHeight / 2);
+ const rect = buttonEl.value.getBoundingClientRect();
+ const x = rect.left + 16;
+ const y = rect.top + (buttonEl.value.offsetHeight / 2);
os.popup(MkPlusOneEffect, { reaction: props.reaction, x, y }, {}, 'end');
};
@@ -72,7 +72,7 @@ onMounted(() => {
if (!props.isInitial) anime();
});
-useTooltip(buttonRef, async (showing) => {
+useTooltip(buttonEl, async (showing) => {
const reactions = await os.apiGet('notes/reactions', {
noteId: props.note.id,
type: props.reaction,
@@ -87,7 +87,7 @@ useTooltip(buttonRef, async (showing) => {
reaction: props.reaction,
users,
count: props.count,
- targetElement: buttonRef.value,
+ targetElement: buttonEl.value,
}, {}, 'closed');
}, 100);
</script>