1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-31 04:33:58 +02:00
This commit is contained in:
syuilo
2025-08-25 13:34:17 +09:00
parent f4baa973bf
commit caf6a3ab81
5 changed files with 10 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ import { prefer } from '@/preferences.js';
const props = defineProps<{
showing: boolean;
url: string;
source: HTMLElement;
anchorEl: HTMLElement;
}>();
const emit = defineEmits<{
@@ -32,9 +32,9 @@ const top = ref(0);
const left = ref(0);
onMounted(() => {
const rect = props.source.getBoundingClientRect();
const x = Math.max((rect.left + (props.source.offsetWidth / 2)) - (300 / 2), 6) + window.scrollX;
const y = rect.top + props.source.offsetHeight + window.scrollY;
const rect = props.anchorEl.getBoundingClientRect();
const x = Math.max((rect.left + (props.anchorEl.offsetWidth / 2)) - (300 / 2), 6) + window.scrollX;
const y = rect.top + props.anchorEl.offsetHeight + window.scrollY;
top.value = y;
left.value = x;