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.js
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

23 lines
368 B
JavaScript

import Component from "@ember/component";
import { action } from "@ember/object";
export default Component.extend({
tagName: "",
collapsed: false,
header: null,
onToggle: null,
@action
open() {
this.set("collapsed", false);
this.onToggle?.(false);
},
@action
close() {
this.set("collapsed", true);
this.onToggle?.(true);
},
});