Emojis update realtime
This commit is contained in:
parent
b338b84f64
commit
90daf060cc
6 changed files with 14 additions and 13 deletions
|
|
@ -72,7 +72,6 @@
|
||||||
:room="room"
|
:room="room"
|
||||||
:event="event"
|
:event="event"
|
||||||
:nextEvent="events[index + 1]"
|
:nextEvent="events[index + 1]"
|
||||||
:reactions="timelineSet.getRelationsForEvent(event.getId(), 'm.annotation', 'm.reaction')"
|
|
||||||
:timelineSet="timelineSet"
|
:timelineSet="timelineSet"
|
||||||
v-on:send-quick-reaction="sendQuickReaction"
|
v-on:send-quick-reaction="sendQuickReaction"
|
||||||
v-on:context-menu="showContextMenuForEvent($event)"
|
v-on:context-menu="showContextMenuForEvent($event)"
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
:room="room"
|
:room="room"
|
||||||
:event="event"
|
:event="event"
|
||||||
:nextEvent="events[index + 1]"
|
:nextEvent="events[index + 1]"
|
||||||
:reactions="timelineSet.getRelationsForEvent(event.getId(), 'm.annotation', 'm.reaction')"
|
|
||||||
:timelineSet="timelineSet"
|
:timelineSet="timelineSet"
|
||||||
ref="exportedEvent"
|
ref="exportedEvent"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
><v-icon>more_vert</v-icon></v-btn
|
><v-icon>more_vert</v-icon></v-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<QuickReactions :event="event" :reactions="reactions" />
|
<QuickReactions :event="event" :timelineSet="timelineSet" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<div class="status">{{ event.status }}</div>
|
<div class="status">{{ event.status }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<QuickReactions :event="event" :reactions="reactions" />
|
<QuickReactions :event="event" :timelineSet="timelineSet" />
|
||||||
<div class="op-button" ref="opbutton">
|
<div class="op-button" ref="opbutton">
|
||||||
<v-btn id="btn-show-menu" icon @click.stop="showContextMenu($refs.opbutton)"
|
<v-btn id="btn-show-menu" icon @click.stop="showContextMenu($refs.opbutton)"
|
||||||
><v-icon>more_vert</v-icon></v-btn
|
><v-icon>more_vert</v-icon></v-btn
|
||||||
|
|
|
||||||
|
|
@ -15,24 +15,33 @@ export default {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reactions: {
|
timelineSet: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: function () {
|
default: function () {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
reactionMap: {}
|
reactionMap: {},
|
||||||
|
reactions: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.reactions = this.timelineSet.getRelationsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
|
||||||
|
this.event.on("Event.relationsCreated", this.onRelationsCreated);
|
||||||
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
this.event.off("Event.relationsCreated", this.onRelationsCreated);
|
||||||
if (this.reactions) {
|
if (this.reactions) {
|
||||||
this.reactions.off('Relations.add', this.onAddRelation);
|
this.reactions.off('Relations.add', this.onAddRelation);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onRelationsCreated() {
|
||||||
|
this.reactions = this.timelineSet.getRelationsForEvent(this.event.getId(), 'm.annotation', 'm.reaction');
|
||||||
|
},
|
||||||
onClickEmoji(emoji) {
|
onClickEmoji(emoji) {
|
||||||
this.$bubble('send-quick-reaction', {reaction:emoji, event:this.event});
|
this.$bubble('send-quick-reaction', {reaction:emoji, event:this.event});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@ export default {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
reactions: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
timelineSet: {
|
timelineSet: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: function () {
|
default: function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue