Skip to content

Commit c8e985e

Browse files
committed
(fix) image loader position
1 parent d8a23d2 commit c8e985e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/ChatWindow/ChatMessage.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
<div class="image-container" v-else-if="isImage">
6464
<chat-loader
65-
class="image-loader"
65+
:style="{ top: `${imageResponsive.loaderTop}px` }"
6666
:show="isImageLoading"
6767
></chat-loader>
6868
<div
@@ -73,7 +73,7 @@
7373
}"
7474
:style="{
7575
background: `url(${message.file.url})`,
76-
'max-height': `${imageMaxHeight}px`
76+
'max-height': `${imageResponsive.maxHeight}px`
7777
}"
7878
>
7979
<transition name="fade-image">
@@ -232,7 +232,7 @@ export default {
232232
messageReaction: '',
233233
newMessage: {},
234234
emojiOpened: false,
235-
imageMaxHeight: ''
235+
imageResponsive: ''
236236
}
237237
},
238238
@@ -267,7 +267,10 @@ export default {
267267
index: this.index
268268
})
269269
}
270-
this.imageMaxHeight = this.$refs.imageRef.clientWidth - 18
270+
this.imageResponsive = {
271+
maxHeight: this.$refs.imageRef.clientWidth - 18,
272+
loaderTop: this.$refs.imageRef.clientWidth / 2
273+
}
271274
},
272275
273276
computed: {
@@ -528,10 +531,6 @@ export default {
528531
width: 70px;
529532
}
530533
531-
.image-loader {
532-
top: 140px;
533-
}
534-
535534
.message-image {
536535
position: relative;
537536
background-color: var(--chat-message-bg-color-image) !important;

0 commit comments

Comments
 (0)