This commit is contained in:
syuilo 2020-09-06 23:06:30 +09:00
parent 280e74749f
commit 02701d852d
5 changed files with 34 additions and 95 deletions

View file

@ -1,5 +1,5 @@
<template>
<XModal :source="source" ref="popup" @closed="destroy" v-hotkey.global="keymap">
<XModal :source="source" @closed="$emit('closed')" :showing="showing" @click="close" v-hotkey.global="keymap">
<div class="rdfaahpb">
<div class="buttons" ref="buttons" :class="{ showFocus }">
<button class="_button" v-for="(reaction, i) in rs" :key="reaction" @click="react(reaction)" :tabindex="i + 1" :title="reaction" v-particle><x-reaction-icon :reaction="reaction"/></button>
@ -23,10 +23,7 @@ export default defineComponent({
},
props: {
destroy: {
required: true
},
emit: {
showing: {
required: true
},
@ -88,11 +85,11 @@ export default defineComponent({
methods: {
close() {
this.$refs.popup.close();
this.$emit('done');
},
react(reaction) {
this.$emit('chosen', reaction);
this.$emit('done', reaction);
},
reactText() {
@ -131,6 +128,10 @@ export default defineComponent({
<style lang="scss" scoped>
.rdfaahpb {
background: var(--panel);
border-radius: 8px;
box-shadow: 0 3px 12px rgba(27, 31, 35, 0.15);
> .buttons {
padding: 6px 6px 0 6px;
width: 212px;