Skip to content

Commit

Permalink
DEV: Add user-tip back to glimmer-topic-timeline (#20165)
Browse files Browse the repository at this point in the history
Add the user-tip back to the glimmer topic timeline

<img width="555" alt="Screenshot 2023-02-03 at 9 38 45 AM" src="https://user-images.githubusercontent.com/50783505/216644897-cdd3244f-e565-49ea-a929-5faa87f8ce57.png">
  • Loading branch information
janzenisaac committed Feb 3, 2023
1 parent d90a31d commit 2bff6db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Expand Up @@ -2,7 +2,7 @@
class={{concat "timeline-container " this.classes}}
{{did-insert this.addShowClass}}
>
<div class="topic-timeline">
<div class="topic-timeline" {{did-insert this.addUserTip}}>
<TopicTimeline::Container
@model={{@model}}
@enteredIndex={{this.enteredIndex}}
Expand Down
Expand Up @@ -3,6 +3,7 @@ import { tracked } from "@glimmer/tracking";
import optionalService from "discourse/lib/optional-service";
import { inject as service } from "@ember/service";
import { bind } from "discourse-common/utils/decorators";
import I18n from "I18n";

export default class GlimmerTopicTimeline extends Component {
@service site;
Expand Down Expand Up @@ -83,6 +84,18 @@ export default class GlimmerTopicTimeline extends Component {
}
}

@bind
addUserTip(element) {
this.currentUser.showUserTip({
id: "topic_timeline",
titleText: I18n.t("user_tips.topic_timeline.title"),
contentText: I18n.t("user_tips.topic_timeline.content"),
reference: document.querySelector("div.timeline-scrollarea-wrapper"),
appendTo: element,
placement: "left",
});
}

willDestroy() {
if (!this.site.mobileView) {
this.intersectionObserver?.disconnect();
Expand Down

0 comments on commit 2bff6db

Please sign in to comment.