File tree Expand file tree Collapse file tree 11 files changed +17
-51
lines changed
components/EmojiPickerContainer Expand file tree Collapse file tree 11 files changed +17
-51
lines changed Original file line number Diff line number Diff line change 3737
3838<script >
3939import SvgIcon from ' ../SvgIcon/SvgIcon'
40+ import { findParentBySelector } from ' ../../utils/element-selector'
4041
4142export default {
4243 name: ' EmojiPickerContainer' ,
@@ -121,9 +122,7 @@ export default {
121122 },
122123 setEmojiPickerPosition (clientY , innerWidth , innerHeight ) {
123124 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' )
127126
128127 if (! roomFooterRef) {
129128 if (mobileSize) this .emojiPickerRight = ' -50px'
Original file line number Diff line number Diff line change @@ -335,15 +335,11 @@ export default {
335335 this .observer .disconnect ()
336336 }
337337
338- const loader = document
339- .querySelector (' vue-advanced-chat' )
340- .shadowRoot .getElementById (' infinite-loader-messages' )
338+ const loader = this .$el .querySelector (' #infinite-loader-messages' )
341339
342340 if (loader) {
343341 const options = {
344- root: document
345- .querySelector (' vue-advanced-chat' )
346- .shadowRoot .getElementById (' messages-list' ),
342+ root: this .$el .querySelector (' #messages-list' ),
347343 rootMargin: ` ${ this .scrollDistance } px` ,
348344 threshold: 0
349345 }
Original file line number Diff line number Diff line change 33 <div
44 v-if =" filteredEmojis.length"
55 class =" vac-emojis-container"
6- :style =" { bottom: `${footerHeight}px` }"
76 >
87 <div
98 v-for =" (emoji, index) in filteredEmojis"
@@ -38,11 +37,6 @@ export default {
3837 },
3938
4039 computed: {
41- footerHeight () {
42- return document
43- .querySelector (' vue-advanced-chat' )
44- .shadowRoot .getElementById (' room-footer' ).clientHeight
45- }
4640 },
4741
4842 watch: {
Original file line number Diff line number Diff line change 33 <div
44 v-if =" files.length"
55 class =" vac-room-files-container"
6- :style =" { bottom: `${footerHeight}px` }"
76 >
87 <div class =" vac-files-box" >
98 <div v-for =" (file, i) in files" :key =" i" >
@@ -49,11 +48,6 @@ export default {
4948 emits: [' remove-file' , ' reset-message' ],
5049
5150 computed: {
52- footerHeight () {
53- return document
54- .querySelector (' vue-advanced-chat' )
55- .shadowRoot .getElementById (' room-footer' ).clientHeight
56- }
5751 }
5852}
5953 </script >
Original file line number Diff line number Diff line change 33 <div
44 v-if =" messageReply"
55 class =" vac-reply-container"
6- :style =" { bottom: `${footerHeight}px` }"
76 >
87 <div class =" vac-reply-box" >
98 <div class =" vac-reply-info" >
@@ -98,11 +97,6 @@ export default {
9897 emits: [' reset-message' ],
9998
10099 computed: {
101- footerHeight () {
102- return document
103- .querySelector (' vue-advanced-chat' )
104- .shadowRoot .getElementById (' room-footer' ).clientHeight
105- },
106100 firstFile () {
107101 return this .messageReply ? .files ? .length ? this .messageReply .files [0 ] : {}
108102 },
Original file line number Diff line number Diff line change 33 <div
44 v-if =" filteredTemplatesText.length"
55 class =" vac-template-container vac-app-box-shadow"
6- :style =" { bottom: `${footerHeight}px` }"
76 >
87 <div
98 v-for =" (template, index) in filteredTemplatesText"
@@ -45,11 +44,6 @@ export default {
4544 },
4645
4746 computed: {
48- footerHeight () {
49- return document
50- .querySelector (' vue-advanced-chat' )
51- .shadowRoot .getElementById (' room-footer' ).clientHeight
52- }
5347 },
5448
5549 watch: {
Original file line number Diff line number Diff line change 33 <div
44 v-if =" filteredUsersTag.length"
55 class =" vac-tags-container"
6- :style =" { bottom: `${footerHeight}px` }"
76 >
87 <div
98 v-for =" (user, index) in filteredUsersTag"
@@ -47,11 +46,6 @@ export default {
4746 },
4847
4948 computed: {
50- footerHeight () {
51- return document
52- .querySelector (' vue-advanced-chat' )
53- .shadowRoot .getElementById (' room-footer' ).clientHeight
54- }
5549 },
5650
5751 watch: {
Original file line number Diff line number Diff line change @@ -62,9 +62,7 @@ export default {
6262 },
6363
6464 mounted () {
65- this .player = document
66- .querySelector (' vue-advanced-chat' )
67- .shadowRoot .getElementById (this .playerUniqId )
65+ this .player = this .$el .querySelector (' #' + this .playerUniqId )
6866
6967 this .player .addEventListener (' ended' , () => {
7068 this .isPlaying = false
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ import vClickOutside from '../../../../utils/on-click-outside'
9090
9191import SvgIcon from ' ../../../../components/SvgIcon/SvgIcon'
9292import EmojiPickerContainer from ' ../../../../components/EmojiPickerContainer/EmojiPickerContainer'
93+ import { findParentBySelector } from ' ../../../../utils/element-selector'
9394
9495export default {
9596 name: ' MessageActions' ,
@@ -170,9 +171,7 @@ export default {
170171 if (! this .optionsOpened ) return
171172
172173 setTimeout (() => {
173- const roomFooterRef = document
174- .querySelector (' vue-advanced-chat' )
175- .shadowRoot .getElementById (' room-footer' )
174+ const roomFooterRef = findParentBySelector (this .$el , ' #room-footer' )
176175
177176 if (
178177 ! roomFooterRef ||
Original file line number Diff line number Diff line change @@ -170,15 +170,11 @@ export default {
170170 this .observer .disconnect ()
171171 }
172172
173- const loader = document
174- .querySelector (' vue-advanced-chat' )
175- .shadowRoot .getElementById (' infinite-loader-rooms' )
173+ const loader = this .$el .querySelector (' #infinite-loader-rooms' )
176174
177175 if (loader) {
178176 const options = {
179- root: document
180- .querySelector (' vue-advanced-chat' )
181- .shadowRoot .getElementById (' rooms-list' ),
177+ root: this .$el .querySelector (' #rooms-list' ),
182178 rootMargin: ` ${ this .scrollDistance } px` ,
183179 threshold: 0
184180 }
You can’t perform that action at this time.
0 commit comments