summaryrefslogtreecommitdiff
path: root/src/client/os.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-02-28 01:09:59 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-02-28 01:09:59 +0900
commit764a158cd7e112186cbf54cb77599bcd22ea7d69 (patch)
treef3ef0d147088c65ed4d8573d9579313e153df8ee /src/client/os.ts
parentMerge branch 'develop' of https://github.com/syuilo/misskey into develop (diff)
downloadsharkey-764a158cd7e112186cbf54cb77599bcd22ea7d69.tar.gz
sharkey-764a158cd7e112186cbf54cb77599bcd22ea7d69.tar.bz2
sharkey-764a158cd7e112186cbf54cb77599bcd22ea7d69.zip
Resolve #7270
Diffstat (limited to 'src/client/os.ts')
-rw-r--r--src/client/os.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/client/os.ts b/src/client/os.ts
index a971eebd45..9fafb6db43 100644
--- a/src/client/os.ts
+++ b/src/client/os.ts
@@ -357,6 +357,43 @@ export async function openEmojiPicker(src?: HTMLElement, opts, initialTextarea:
});
}
+let reactionPicker = null;
+export async function pickReaction(src: HTMLElement, chosen, closed) {
+ if (reactionPicker) {
+ if (reactionPicker.opening) return;
+
+ reactionPicker.opening = true;
+ reactionPicker.src.value = src;
+ reactionPicker.manualShowing.value = true;
+ reactionPicker.chosen = chosen;
+ reactionPicker.closed = closed;
+ } else {
+ reactionPicker = {
+ opening: true,
+ src: ref(src),
+ manualShowing: ref(true),
+ chosen, closed
+ };
+ popup(import('@/components/emoji-picker-dialog.vue'), {
+ src: reactionPicker.src,
+ asReactionPicker: true,
+ manualShowing: reactionPicker.manualShowing
+ }, {
+ done: reaction => {
+ reactionPicker.chosen(reaction);
+ },
+ close: () => {
+ reactionPicker.manualShowing.value = false;
+ },
+ closed: () => {
+ reactionPicker.src.value = null;
+ reactionPicker.closed();
+ reactionPicker.opening = false;
+ }
+ });
+ }
+}
+
export function modalMenu(items: any[], src?: HTMLElement, options?: { align?: string; viaKeyboard?: boolean }) {
return new Promise((resolve, reject) => {
let dispose;