File tree Expand file tree Collapse file tree 11 files changed +19
-68
lines changed
components/EmojiPickerContainer Expand file tree Collapse file tree 11 files changed +19
-68
lines changed Original file line number Diff line number Diff line change 37
37
38
38
<script >
39
39
import SvgIcon from ' ../SvgIcon/SvgIcon'
40
+ import { findParentBySelector } from ' ../../utils/element-selector'
40
41
41
42
export default {
42
43
name: ' EmojiPickerContainer' ,
@@ -121,9 +122,7 @@ export default {
121
122
},
122
123
setEmojiPickerPosition (clientY , innerWidth , innerHeight ) {
123
124
const mobileSize = innerWidth < 500 || innerHeight < 700
124
- const roomFooterRef = document
125
- .querySelector (' vue-advanced-chat' )
126
- .shadowRoot .getElementById (' room-footer' )
125
+ const roomFooterRef = findParentBySelector (this .$el , ' #room-footer' )
127
126
128
127
if (! roomFooterRef) {
129
128
if (mobileSize) this .emojiPickerRight = ' -50px'
Original file line number Diff line number Diff line change @@ -335,15 +335,11 @@ export default {
335
335
this .observer .disconnect ()
336
336
}
337
337
338
- const loader = document
339
- .querySelector (' vue-advanced-chat' )
340
- .shadowRoot .getElementById (' infinite-loader-messages' )
338
+ const loader = this .$el .querySelector (' #infinite-loader-messages' )
341
339
342
340
if (loader) {
343
341
const options = {
344
- root: document
345
- .querySelector (' vue-advanced-chat' )
346
- .shadowRoot .getElementById (' messages-list' ),
342
+ root: this .$el .querySelector (' #messages-list' ),
347
343
rootMargin: ` ${ this .scrollDistance } px` ,
348
344
threshold: 0
349
345
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<transition name =" vac-slide-up" >
3
- <div
4
- v-if =" filteredEmojis.length"
5
- class =" vac-emojis-container"
6
- :style =" { bottom: `${footerHeight}px` }"
7
- >
3
+ <div v-if =" filteredEmojis.length" class =" vac-emojis-container" >
8
4
<div
9
5
v-for =" (emoji, index) in filteredEmojis"
10
6
:key =" emoji"
@@ -37,14 +33,6 @@ export default {
37
33
}
38
34
},
39
35
40
- computed: {
41
- footerHeight () {
42
- return document
43
- .querySelector (' vue-advanced-chat' )
44
- .shadowRoot .getElementById (' room-footer' ).clientHeight
45
- }
46
- },
47
-
48
36
watch: {
49
37
filteredEmojis (val , oldVal ) {
50
38
if (! oldVal .length || val .length !== oldVal .length ) {
Original file line number Diff line number Diff line change 3
3
<div
4
4
v-if =" files.length"
5
5
class =" vac-room-files-container"
6
- :style =" { bottom: `${footerHeight}px` }"
7
6
>
8
7
<div class =" vac-files-box" >
9
8
<div v-for =" (file, i) in files" :key =" i" >
@@ -49,11 +48,6 @@ export default {
49
48
emits: [' remove-file' , ' reset-message' ],
50
49
51
50
computed: {
52
- footerHeight () {
53
- return document
54
- .querySelector (' vue-advanced-chat' )
55
- .shadowRoot .getElementById (' room-footer' ).clientHeight
56
- }
57
51
}
58
52
}
59
53
</script >
Original file line number Diff line number Diff line change 3
3
<div
4
4
v-if =" messageReply"
5
5
class =" vac-reply-container"
6
- :style =" { bottom: `${footerHeight}px` }"
7
6
>
8
7
<div class =" vac-reply-box" >
9
8
<div class =" vac-reply-info" >
@@ -98,11 +97,6 @@ export default {
98
97
emits: [' reset-message' ],
99
98
100
99
computed: {
101
- footerHeight () {
102
- return document
103
- .querySelector (' vue-advanced-chat' )
104
- .shadowRoot .getElementById (' room-footer' ).clientHeight
105
- },
106
100
firstFile () {
107
101
return this .messageReply ? .files ? .length ? this .messageReply .files [0 ] : {}
108
102
},
Original file line number Diff line number Diff line change 3
3
<div
4
4
v-if =" filteredTemplatesText.length"
5
5
class =" vac-template-container vac-app-box-shadow"
6
- :style =" { bottom: `${footerHeight}px` }"
7
6
>
8
7
<div
9
8
v-for =" (template, index) in filteredTemplatesText"
@@ -44,14 +43,6 @@ export default {
44
43
}
45
44
},
46
45
47
- computed: {
48
- footerHeight () {
49
- return document
50
- .querySelector (' vue-advanced-chat' )
51
- .shadowRoot .getElementById (' room-footer' ).clientHeight
52
- }
53
- },
54
-
55
46
watch: {
56
47
filteredTemplatesText (val , oldVal ) {
57
48
if (! oldVal .length || val .length !== oldVal .length ) {
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<transition name =" vac-slide-up" >
3
- <div
4
- v-if =" filteredUsersTag.length"
5
- class =" vac-tags-container"
6
- :style =" { bottom: `${footerHeight}px` }"
7
- >
3
+ <div v-if =" filteredUsersTag.length" class =" vac-tags-container" >
8
4
<div
9
5
v-for =" (user, index) in filteredUsersTag"
10
6
:key =" user._id"
@@ -46,14 +42,6 @@ export default {
46
42
}
47
43
},
48
44
49
- computed: {
50
- footerHeight () {
51
- return document
52
- .querySelector (' vue-advanced-chat' )
53
- .shadowRoot .getElementById (' room-footer' ).clientHeight
54
- }
55
- },
56
-
57
45
watch: {
58
46
filteredUsersTag (val , oldVal ) {
59
47
if (! oldVal .length || val .length !== oldVal .length ) {
Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ export default {
62
62
},
63
63
64
64
mounted () {
65
- this .player = document
66
- .querySelector (' vue-advanced-chat' )
67
- .shadowRoot .getElementById (this .playerUniqId )
65
+ this .player = this .$el .querySelector (' #' + this .playerUniqId )
68
66
69
67
this .player .addEventListener (' ended' , () => {
70
68
this .isPlaying = false
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ import vClickOutside from '../../../../utils/on-click-outside'
90
90
91
91
import SvgIcon from ' ../../../../components/SvgIcon/SvgIcon'
92
92
import EmojiPickerContainer from ' ../../../../components/EmojiPickerContainer/EmojiPickerContainer'
93
+ import { findParentBySelector } from ' ../../../../utils/element-selector'
93
94
94
95
export default {
95
96
name: ' MessageActions' ,
@@ -170,9 +171,7 @@ export default {
170
171
if (! this .optionsOpened ) return
171
172
172
173
setTimeout (() => {
173
- const roomFooterRef = document
174
- .querySelector (' vue-advanced-chat' )
175
- .shadowRoot .getElementById (' room-footer' )
174
+ const roomFooterRef = findParentBySelector (this .$el , ' #room-footer' )
176
175
177
176
if (
178
177
! roomFooterRef ||
Original file line number Diff line number Diff line change @@ -170,15 +170,11 @@ export default {
170
170
this .observer .disconnect ()
171
171
}
172
172
173
- const loader = document
174
- .querySelector (' vue-advanced-chat' )
175
- .shadowRoot .getElementById (' infinite-loader-rooms' )
173
+ const loader = this .$el .querySelector (' #infinite-loader-rooms' )
176
174
177
175
if (loader) {
178
176
const options = {
179
- root: document
180
- .querySelector (' vue-advanced-chat' )
181
- .shadowRoot .getElementById (' rooms-list' ),
177
+ root: this .$el .querySelector (' #rooms-list' ),
182
178
rootMargin: ` ${ this .scrollDistance } px` ,
183
179
threshold: 0
184
180
}
You can’t perform that action at this time.
0 commit comments