95
95
</transition >
96
96
97
97
<div class =" box-footer" >
98
- <div v-if =" imageFile" >
98
+ <div class = " image-container " v-if =" imageFile" >
99
99
<div class =" svg-button icon-image" @click =" resetImageFile" >
100
100
<svg-icon name =" close" param =" image" />
101
101
</div >
102
102
<div class =" image-file" >
103
- <img :src =" imageFile" />
103
+ <img ref = " imageFile " :src =" imageFile" />
104
104
</div >
105
105
</div >
106
106
118
118
v-show =" !file || imageFile"
119
119
ref =" roomTextarea"
120
120
:placeholder =" textMessages.TYPE_MESSAGE"
121
- :class =" { 'textarea-outline': editedMessage._id }"
121
+ :class =" {
122
+ 'textarea-outline': editedMessage._id,
123
+ 'textarea-image': imageFile
124
+ }"
125
+ :style =" {
126
+ height: `${imageDimensions.height}px`,
127
+ 'min-height': `${imageDimensions.height - 14}px`,
128
+ 'padding-left': `${imageDimensions.width}px`
129
+ }"
122
130
v-model =" message"
123
131
@input =" autoGrow"
124
132
@keydown.esc =" resetMessage"
@@ -209,6 +217,7 @@ export default {
209
217
loadingMessages: false ,
210
218
file: null ,
211
219
imageFile: null ,
220
+ imageDimensions: { height: ' 32px' , width: ' 10px' },
212
221
menuOpened: false ,
213
222
emojiOpened: false ,
214
223
scrollIcon: false
@@ -259,6 +268,17 @@ export default {
259
268
messagesLoaded (val ) {
260
269
if (val) this .loadingMessages = false
261
270
if (this .infiniteState ) this .infiniteState .complete ()
271
+ },
272
+ imageFile () {
273
+ setTimeout (() => {
274
+ if (! this .$refs .imageFile )
275
+ return (this .imageDimensions = { height: 32 , width: 10 })
276
+
277
+ this .imageDimensions = {
278
+ height: this .$refs .imageFile .height + 2 ,
279
+ width: this .$refs .imageFile .width + 20
280
+ }
281
+ }, 20 )
262
282
}
263
283
},
264
284
@@ -439,7 +459,7 @@ export default {
439
459
440
460
.container-scroll {
441
461
background : var (--chat-content-bg-color );
442
- height : calc (100% - 120 px );
462
+ height : calc (100% - 110 px );
443
463
overflow-y : auto ;
444
464
margin-right : 1px ;
445
465
}
@@ -486,7 +506,7 @@ export default {
486
506
.box-footer {
487
507
display : flex ;
488
508
background : var (--chat-footer-bg-color );
489
- padding : 8px ;
509
+ padding : 0 8 px 8px ;
490
510
491
511
* {
492
512
z-index : 1 ;
@@ -495,8 +515,8 @@ export default {
495
515
496
516
.reply-container {
497
517
display : flex ;
498
- padding : 10px 10px 0 ;
499
- background : var (--chat-footer -bg-color );
518
+ padding : 10px 10px 10 px ;
519
+ background : var (--chat-content -bg-color );
500
520
z-index : -1 ;
501
521
align-items : center ;
502
522
max-width : 100% ;
@@ -540,15 +560,14 @@ textarea {
540
560
background : var (--chat-bg-color-input );
541
561
color : var (--chat-color );
542
562
border-radius : 20px ;
543
- margin : 2px ;
544
- padding : 12px 15px 0 10px ;
563
+ padding : 12px 140px 0 10px ;
545
564
overflow : hidden ;
546
565
outline : 0 ;
547
566
width : 100% ;
548
567
resize : none ;
549
568
height : 32px ;
550
569
caret-color : var (--chat-color-caret );
551
- border : none ;
570
+ border : var ( --chat-border-style-input ) ;
552
571
font-size : 16px ;
553
572
554
573
& ::placeholder {
@@ -557,10 +576,16 @@ textarea {
557
576
}
558
577
559
578
.textarea-outline {
560
- box-shadow : inset 0px 0px 0px 1px var (--chat-border-color-input-selected );
579
+ border : 1px solid var (--chat-border-color-input-selected );
580
+ }
581
+
582
+ .textarea-image {
583
+ padding-left : 200px ;
561
584
}
562
585
563
586
.icon-textarea {
587
+ position : absolute ;
588
+ right : 20px ;
564
589
display : flex ;
565
590
margin : 12px 0 0 5px ;
566
591
@@ -570,20 +595,27 @@ textarea {
570
595
}
571
596
}
572
597
598
+ .image-container {
599
+ position : absolute ;
600
+ left : 16px ;
601
+ bottom : 15px ;
602
+ z-index : 2 ;
603
+ }
604
+
573
605
.image-file {
574
606
display : flex ;
575
- margin-right : 10px ;
576
607
577
608
img {
609
+ border-radius : 20px ;
578
610
max-width : 250px ;
579
611
max-height : 100% ;
580
612
}
581
613
}
582
614
583
615
.icon-image {
584
616
position : absolute ;
585
- top : 15 px ;
586
- left : 15 px ;
617
+ top : 10 px ;
618
+ left : 10 px ;
587
619
z-index : 2 ;
588
620
589
621
svg {
@@ -599,7 +631,10 @@ textarea {
599
631
display : flex ;
600
632
align-items : center ;
601
633
width : 100% ;
602
- height : 48px ;
634
+ height : 44px ;
635
+ background : var (--chat-bg-color-input );
636
+ border : var (--chat-border-style-input );
637
+ border-radius : 20px ;
603
638
}
604
639
605
640
.icon-file {
0 commit comments