Clean up code
This commit is contained in:
parent
081a416103
commit
47af5419b1
@ -192,13 +192,9 @@ const EmojiPicker = {
|
|||||||
setScroll(right + margin - headerCont.clientWidth)
|
setScroll(right + margin - headerCont.clientWidth)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlight (index) {
|
highlight (groupId) {
|
||||||
this.setShowStickers(false)
|
this.setShowStickers(false)
|
||||||
const item = this.filteredEmojiGroups[index]
|
const indexInList = this.emojiItems.findIndex(k => k.id === groupId)
|
||||||
if (!item) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const indexInList = this.emojiItems.findIndex(k => k.id === item.id)
|
|
||||||
this.$refs['emoji-groups'].scrollToItem(indexInList)
|
this.$refs['emoji-groups'].scrollToItem(indexInList)
|
||||||
},
|
},
|
||||||
updateScrolledClass (target) {
|
updateScrolledClass (target) {
|
||||||
@ -261,9 +257,6 @@ const EmojiPicker = {
|
|||||||
this.filteredEmojiGroups = this.getFilteredEmojiGroups()
|
this.filteredEmojiGroups = this.getFilteredEmojiGroups()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
this.recalculateItemPerRow()
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
minItemSize () {
|
minItemSize () {
|
||||||
return this.emojiHeight
|
return this.emojiHeight
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
class="emoji-tabs"
|
class="emoji-tabs"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-for="(group, index) in filteredEmojiGroups"
|
v-for="group in filteredEmojiGroups"
|
||||||
:ref="setGroupRef('group-header-' + group.id)"
|
:ref="setGroupRef('group-header-' + group.id)"
|
||||||
:key="group.id"
|
:key="group.id"
|
||||||
class="emoji-tabs-item"
|
class="emoji-tabs-item"
|
||||||
@ -21,7 +21,7 @@
|
|||||||
active: activeGroupView === group.id
|
active: activeGroupView === group.id
|
||||||
}"
|
}"
|
||||||
:title="group.text"
|
:title="group.text"
|
||||||
@click.prevent="highlight(index)"
|
@click.prevent="highlight(group.id)"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="group.image"
|
v-if="group.image"
|
||||||
|
Loading…
Reference in New Issue
Block a user