This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/components/collapser.hbs
Joffrey JAFFEUX b5e736504a
PERF: applies optimisations on chat-live pane (#20532)
- group writes when computing separators positions
- shows skeleton only on initial load
- forces date separator to be pinned when first message to prevent a pinned - not pinned - pinned sequence when loading more in past
- relies on `message.visible` property instead of checking `isElementInViewport`
- attempts to load next/prev messages earlier
- do not scroll to on fetch more
- hides `last visit` text while pinned
2023-03-06 16:42:11 +01:00

26 lines
558 B
Handlebars

<div class="chat-message-collapser-header">
{{this.header}}
{{#if this.collapsed}}
<DButton
@action={{action "open"}}
@icon="caret-right"
@class="chat-message-collapser-button chat-message-collapser-closed"
/>
{{else}}
<DButton
@action={{action "close"}}
@icon="caret-down"
@class="chat-message-collapser-button chat-message-collapser-opened"
/>
{{/if}}
</div>
<div
class={{concat-class
"chat-message-collapser-body"
(if this.collapsed "hidden")
}}
>
{{yield this.collapsed}}
</div>