fix shoutbox header, use custom scroll-to-bottom system, remove vue-chat-scroll, temporarily add chat test hack
This commit is contained in:
parent
30057a4944
commit
0673511fc2
7 changed files with 42 additions and 13 deletions
|
@ -35,6 +35,18 @@ const chatPanel = {
|
|||
userProfileLink (user) {
|
||||
return generateProfileLink(user.id, user.username, this.$store.state.instance.restrictedNicknames)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
messages (newVal) {
|
||||
const scrollEl = this.$el.querySelector('.chat-window')
|
||||
if (!scrollEl) return
|
||||
if (scrollEl.scrollTop + scrollEl.offsetHeight + 20 > scrollEl.scrollHeight) {
|
||||
this.$nextTick(() => {
|
||||
if (!scrollEl) return
|
||||
scrollEl.scrollTop = scrollEl.scrollHeight - scrollEl.offsetHeight
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue