Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/assets/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ $chat-font-size: 15px;
$chat-line-height: 1.6em;

// fade transition
$fade-transition: all var(--animation-quick, 100ms) ease-in-out;

.fade {
&-enter {
opacity: 0;
Expand All @@ -97,7 +99,7 @@ $chat-line-height: 1.6em;
}
&-enter-active,
&-leave-active {
transition: all 150ms ease-in-out;
transition: $fade-transition;
}
}

Expand All @@ -120,7 +122,7 @@ $chat-line-height: 1.6em;
}
&-enter-active,
&-leave-active {
transition: all 150ms ease-in-out;
transition: $fade-transition;
/* force top container to resize during animation */
position: absolute !important;
}
Expand Down
16 changes: 4 additions & 12 deletions src/components/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,15 @@
</transition>
<MessagesList role="region"
:aria-label="t('spreed', 'Conversation messages')"
:is-chat-scrolled-to-bottom="isChatScrolledToBottom"
:token="token"
:is-visible="isVisible"
@set-chat-scrolled-to-bottom="setScrollStatus" />
:is-visible="isVisible" />
<NewMessageForm role="region"
:token="token"
:is-chat-scrolled-to-bottom="isChatScrolledToBottom"
:aria-label="t('spreed', 'Post message')" />
</div>
</template>

<script>
import { getCapabilities } from '@nextcloud/capabilities'

import MessagesList from './MessagesList/MessagesList.vue'
import NewMessageForm from './NewMessageForm/NewMessageForm.vue'

Expand All @@ -78,7 +73,6 @@ export default {
data() {
return {
isDraggingOver: false,
isChatScrolledToBottom: getCapabilities()?.spreed?.config?.chat?.legacy || false,
}
},

Expand Down Expand Up @@ -134,16 +128,14 @@ export default {
// Uploads and shares the files
this.$store.dispatch('initialiseUpload', { files, token: this.token, uploadId })
},

setScrollStatus(payload) {
this.isChatScrolledToBottom = payload
},
},

}
</script>

<style lang="scss" scoped>
@import '../assets/variables';

.chatView {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -195,7 +187,7 @@ export default {
}
&-enter-active,
&-leave-active {
transition: all 150ms ease-in-out;
transition: $fade-transition;
}
}
</style>
Loading