絵文字ピッカーを強化 + 絵文字ピッカーをリアクションピッカーとして使えるように

Resolve #5079
Resolve #3219
This commit is contained in:
syuilo
2020-11-07 10:43:27 +09:00
parent 888dcd2559
commit bef2534fa8
5 changed files with 369 additions and 154 deletions

View File

@@ -498,20 +498,36 @@ export default defineComponent({
react(viaKeyboard = false) {
pleaseLogin();
this.blur();
os.popup(import('@/components/reaction-picker.vue'), {
showFocus: viaKeyboard,
src: this.$refs.reactButton,
}, {
done: reaction => {
if (reaction) {
os.api('notes/reactions/create', {
noteId: this.appearNote.id,
reaction: reaction
});
}
this.focus();
},
}, 'closed');
if (this.$store.state.device.useFullReactionPicker) {
os.popup(import('@/components/emoji-picker.vue'), {
src: this.$refs.reactButton,
}, {
done: reaction => {
if (reaction) {
os.api('notes/reactions/create', {
noteId: this.appearNote.id,
reaction: reaction
});
}
this.focus();
},
}, 'closed');
} else {
os.popup(import('@/components/reaction-picker.vue'), {
showFocus: viaKeyboard,
src: this.$refs.reactButton,
}, {
done: reaction => {
if (reaction) {
os.api('notes/reactions/create', {
noteId: this.appearNote.id,
reaction: reaction
});
}
this.focus();
},
}, 'closed');
}
},
reactDirectly(reaction) {