From 47af5419b13688893a38c34fd55f4edf58dad6b2 Mon Sep 17 00:00:00 2001 From: tusooa Date: Mon, 2 Jan 2023 14:01:56 -0500 Subject: [PATCH] Clean up code --- src/components/emoji_picker/emoji_picker.js | 11 ++--------- src/components/emoji_picker/emoji_picker.vue | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index ca2a3683..4a447905 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -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 diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue index ae4683f5..453ecdfc 100644 --- a/src/components/emoji_picker/emoji_picker.vue +++ b/src/components/emoji_picker/emoji_picker.vue @@ -13,7 +13,7 @@ class="emoji-tabs" >