diff options
| author | Shpuld Shpludson <shp@cock.li> | 2021-03-03 15:07:10 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2021-03-03 15:07:10 +0000 |
| commit | fb183adc741419fec21e2df60a5fa98084983a13 (patch) | |
| tree | dfd86410926eb0224f300df6439ab27775cdb51a /src/components/chat_panel | |
| parent | 30057a494441b01c0db85ec302aed224cf0768f2 (diff) | |
| parent | becacf064303f0fceca8def3f1c49248b9d3e5f8 (diff) | |
Merge branch 'fix/shoutbox-fixes' into 'develop'
Remove vue-chat-scroll, fix up shoutbox header
See merge request pleroma/pleroma-fe!1368
Diffstat (limited to 'src/components/chat_panel')
| -rw-r--r-- | src/components/chat_panel/chat_panel.js | 12 | ||||
| -rw-r--r-- | src/components/chat_panel/chat_panel.vue | 15 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js index c3887098..556694ae 100644 --- a/src/components/chat_panel/chat_panel.js +++ b/src/components/chat_panel/chat_panel.js @@ -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 + }) + } + } } } diff --git a/src/components/chat_panel/chat_panel.vue b/src/components/chat_panel/chat_panel.vue index 7993c94d..8a829115 100644 --- a/src/components/chat_panel/chat_panel.vue +++ b/src/components/chat_panel/chat_panel.vue @@ -10,17 +10,15 @@ @click.stop.prevent="togglePanel" > <div class="title"> - <span>{{ $t('shoutbox.title') }}</span> + {{ $t('shoutbox.title') }} <FAIcon v-if="floating" icon="times" + class="close-icon" /> </div> </div> - <div - v-chat-scroll - class="chat-window" - > + <div class="chat-window"> <div v-for="message in messages" :key="message.id" @@ -94,6 +92,13 @@ .icon { color: $fallback--text; color: var(--text, $fallback--text); + margin-right: 0.5em; + } + + .title { + display: flex; + justify-content: space-between; + align-items: center; } } |
