Clean up code

This commit is contained in:
tusooa 2023-01-02 14:01:56 -05:00
parent 081a416103
commit 47af5419b1
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
2 changed files with 4 additions and 11 deletions

View File

@ -192,13 +192,9 @@ const EmojiPicker = {
setScroll(right + margin - headerCont.clientWidth)
}
},
highlight (index) {
highlight (groupId) {
this.setShowStickers(false)
const item = this.filteredEmojiGroups[index]
if (!item) {
return
}
const indexInList = this.emojiItems.findIndex(k => k.id === item.id)
const indexInList = this.emojiItems.findIndex(k => k.id === groupId)
this.$refs['emoji-groups'].scrollToItem(indexInList)
},
updateScrolledClass (target) {
@ -261,9 +257,6 @@ const EmojiPicker = {
this.filteredEmojiGroups = this.getFilteredEmojiGroups()
}
},
mounted () {
this.recalculateItemPerRow()
},
computed: {
minItemSize () {
return this.emojiHeight

View File

@ -13,7 +13,7 @@
class="emoji-tabs"
>
<span
v-for="(group, index) in filteredEmojiGroups"
v-for="group in filteredEmojiGroups"
:ref="setGroupRef('group-header-' + group.id)"
:key="group.id"
class="emoji-tabs-item"
@ -21,7 +21,7 @@
active: activeGroupView === group.id
}"
:title="group.text"
@click.prevent="highlight(index)"
@click.prevent="highlight(group.id)"
>
<span
v-if="group.image"