From 3c71c565e34883a520964d0f8f7c01eac94ee0b5 Mon Sep 17 00:00:00 2001
From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sat, 6 Jul 2024 21:04:57 +0900
Subject: [PATCH] =?UTF-8?q?tooltip=E3=81=AF=E5=87=BA=E3=81=9B=E3=82=8B?=
=?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/frontend/src/components/MkNoteDetailed.vue | 4 ++--
packages/frontend/src/directives/tooltip.ts | 2 ++
packages/frontend/src/os.ts | 11 ++++++++++-
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue
index d852aca799..18da7a69bc 100644
--- a/packages/frontend/src/components/MkNoteDetailed.vue
+++ b/packages/frontend/src/components/MkNoteDetailed.vue
@@ -58,7 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -283,7 +283,7 @@ import MkPagination, { type Paging } from '@/components/MkPagination.vue';
import MkReactionIcon from '@/components/MkReactionIcon.vue';
import MkButton from '@/components/MkButton.vue';
import { isEnabledUrlPreview, instance } from '@/instance.js';
-import { url } from '@/config.js';
+import { url, instanceName } from '@/config.js';
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;
diff --git a/packages/frontend/src/directives/tooltip.ts b/packages/frontend/src/directives/tooltip.ts
index 251ce5675f..dd9fb50ceb 100644
--- a/packages/frontend/src/directives/tooltip.ts
+++ b/packages/frontend/src/directives/tooltip.ts
@@ -59,6 +59,8 @@ export default {
targetElement: el,
}, {
closed: () => dispose(),
+ }, {
+ callEvenOnEmbedPage: true,
});
self._close = () => {
diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts
index c5e234e6f9..e855cf3d21 100644
--- a/packages/frontend/src/os.ts
+++ b/packages/frontend/src/os.ts
@@ -169,12 +169,21 @@ type EmitsExtractor = {
[K in keyof T as K extends `onVnode${string}` ? never : K extends `on${infer E}` ? Uncapitalize : K extends string ? never : K]: T[K];
};
+type PopupOptions = {
+ callEvenOnEmbedPage?: boolean;
+};
+
export function popup(
component: T,
props: ComponentProps,
events: ComponentEmit = {} as ComponentEmit,
+ options: PopupOptions = {},
): { dispose: () => void } {
- if (embedPage) return { dispose: () => {} };
+ const _options = Object.assign({
+ callEvenOnEmbedPage: false,
+ }, options) as Required;
+
+ if (embedPage && !_options.callEvenOnEmbedPage) return { dispose: () => {} };
markRaw(component);