diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2023-04-24 11:03:50 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2023-04-24 11:03:50 +0200 |
commit | f3c980c77498b213b1eced5f36252d8079757e00 (patch) | |
tree | 85ccdb31e20a39134c529faac2b62a7a856e195b | |
parent | 709927f5a15fcbaf3bb567577848761d176bcc12 (diff) |
replace HTML Collection with HTML NodeList
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/LeftSidebar/LeftSidebar.vue | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 1558cc09b..3213881c4 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -33,7 +33,7 @@ <NewGroupConversation v-if="canStartConversations" /> </div> <template #list> - <li class="left-sidebar__list"> + <li ref="container" class="left-sidebar__list"> <ul ref="scroller" class="scroller" @scroll="debounceHandleScroll"> @@ -556,17 +556,15 @@ export default { }, handleUnreadMention() { this.unreadNum = 0 - const unreadMentions = document.getElementsByClassName('unread-mention-conversation') - if (unreadMentions.length) { - unreadMentions.forEach(x => { - if (this.elementIsBelowViewpoint(this.$refs.container, x)) { - if (this.unreadNum === 0) { - this.firstUnreadPos = x.offsetTop - } - this.unreadNum += 1 + const unreadMentions = document.querySelectorAll('.unread-mention-conversation') + unreadMentions.forEach(x => { + if (this.elementIsBelowViewpoint(this.$refs.container, x)) { + if (this.unreadNum === 0) { + this.firstUnreadPos = x.offsetTop } - }) - } + this.unreadNum += 1 + } + }) }, debounceHandleScroll: debounce(function() { this.handleScroll() |