aboutsummaryrefslogtreecommitdiff
path: root/src/components/emoji_picker/emoji_picker.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2024-06-26 02:15:32 +0300
committerHenry Jameson <me@hjkos.com>2024-06-26 02:15:32 +0300
commitc27bbfd21cbdc222e442c3f020d2f5592e42e5f9 (patch)
treefffa3632f1d21576ecb6f84083b236c25c20ace5 /src/components/emoji_picker/emoji_picker.js
parent1e0d75782fc8b5baaf3ac982da1a2d02382d8bca (diff)
some improvements from testing prod
Diffstat (limited to 'src/components/emoji_picker/emoji_picker.js')
-rw-r--r--src/components/emoji_picker/emoji_picker.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index 862f6aa4..f86c4330 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -106,9 +106,6 @@ const EmojiPicker = {
}
},
inject: ['popoversZLayer'],
- mounted () {
- this.updateEmojiSize()
- },
data () {
return {
keyword: '',
@@ -138,7 +135,7 @@ const EmojiPicker = {
const css = window.getComputedStyle(this.$refs.popover.$el)
const emojiSize = css.getPropertyValue('--emojiSize')
const emojiSizeUnit = emojiSize.replace(/[0-9,.]+/, '')
- const emojiSizeValue = emojiSize.replace(/[^0-9,.]+/, '')
+ const emojiSizeValue = Number(emojiSize.replace(/[^0-9,.]+/, ''))
const fontSize = css.getPropertyValue('font-size').replace(/[^0-9,.]+/, '')
let emojiSizeReal
@@ -245,6 +242,7 @@ const EmojiPicker = {
},
onShowing () {
const oldContentLoaded = this.contentLoaded
+ this.updateEmojiSize()
this.recalculateItemPerRow()
this.$nextTick(() => {
this.$refs.search.focus()
@@ -287,7 +285,7 @@ const EmojiPicker = {
},
computed: {
minItemSize () {
- return this.emojiHeight
+ return this.emojiSize
},
// used to watch it
fontSize () {
@@ -299,15 +297,12 @@ const EmojiPicker = {
emojiHeight () {
return this.emojiSize
},
- emojiWidth () {
- return this.emojiSize
- },
itemPerRow () {
console.log(
- this.emojiWidth,
+ this.emojiSize,
this.width
)
- return this.width ? Math.floor(this.width / this.emojiWidth) : 6
+ return this.width ? Math.floor(this.width / this.emojiSize) : 6
},
activeGroupView () {
return this.showingStickers ? '' : this.activeGroup