diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2021-02-28 01:09:59 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2021-02-28 01:09:59 +0900 |
| commit | 764a158cd7e112186cbf54cb77599bcd22ea7d69 (patch) | |
| tree | f3ef0d147088c65ed4d8573d9579313e153df8ee /src/client/os.ts | |
| parent | Merge branch 'develop' of https://github.com/syuilo/misskey into develop (diff) | |
| download | sharkey-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.ts | 37 |
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; |