リアクションの修正 (#6260)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<button
|
||||
class="hkzvhatu _button"
|
||||
:class="{ reacted: note.myReaction == reaction }"
|
||||
:class="{ reacted: note.myReaction == reaction, canToggle }"
|
||||
@click="toggleReaction(reaction)"
|
||||
v-if="count > 0"
|
||||
@mouseover="onMouseover"
|
||||
@ -40,11 +40,6 @@ export default Vue.extend({
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
canToggle: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -57,6 +52,9 @@ export default Vue.extend({
|
||||
isMe(): boolean {
|
||||
return this.$store.getters.isSignedIn && this.$store.state.i.id === this.note.userId;
|
||||
},
|
||||
canToggle(): boolean {
|
||||
return !this.reaction.match(/@\w/);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (!this.isInitial) this.anime();
|
||||
@ -144,6 +142,18 @@ export default Vue.extend({
|
||||
padding: 0 6px;
|
||||
border-radius: 4px;
|
||||
|
||||
&.canToggle {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.canToggle) {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
&.reacted {
|
||||
background: var(--accent);
|
||||
|
||||
@ -152,14 +162,6 @@ export default Vue.extend({
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.reacted) {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
> span {
|
||||
font-size: 0.9em;
|
||||
line-height: 32px;
|
||||
|
Reference in New Issue
Block a user