Fix/popover performance

This commit is contained in:
Shpuld Shpludson 2020-02-28 16:39:47 +00:00
parent d19c64314f
commit 31225f5d14
20 changed files with 393 additions and 330 deletions
src/components/react_button

View file

@ -1,34 +1,25 @@
import Popover from '../popover/popover.vue'
import { mapGetters } from 'vuex'
const ReactButton = {
props: ['status', 'loggedIn'],
data () {
return {
showTooltip: false,
filterWord: '',
popperOptions: {
modifiers: {
preventOverflow: { padding: { top: 50 }, boundariesElement: 'viewport' }
}
}
filterWord: ''
}
},
components: {
Popover
},
methods: {
openReactionSelect () {
this.showTooltip = true
this.filterWord = ''
},
closeReactionSelect () {
this.showTooltip = false
},
addReaction (event, emoji) {
addReaction (event, emoji, close) {
const existingReaction = this.status.emoji_reactions.find(r => r.name === emoji)
if (existingReaction && existingReaction.me) {
this.$store.dispatch('unreactWithEmoji', { id: this.status.id, emoji })
} else {
this.$store.dispatch('reactWithEmoji', { id: this.status.id, emoji })
}
this.closeReactionSelect()
close()
}
},
computed: {