diff --git a/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.hbs b/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.hbs index d7243af8a54..6f557278e3e 100644 --- a/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.hbs +++ b/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.hbs @@ -7,6 +7,7 @@ @jumpBottom={{@jumpBottom}} @jumpEnd={{@jumpEnd}} @jumpToIndex={{@jumpToIndex}} + @jumpToPostPrompt={{@jumpToPostPrompt}} @fullscreen={{@fullscreen}} @mobileView={{@mobileView}} @currentUser={{this.currentUser}} @@ -23,50 +24,7 @@ @resetBumpDate={{@resetBumpDate}} @convertToPublicTopic={{@convertToPublicTopic}} @convertToPrivateMessage={{@convertToPrivateMessage}} + @replyToPost={{@replyToPost}} /> - - diff --git a/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.js b/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.js index 814fb951cc1..7c7f7889321 100644 --- a/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.js +++ b/app/assets/javascripts/discourse/app/components/glimmer-topic-timeline.js @@ -79,10 +79,6 @@ export default class GlimmerTopicTimeline extends Component { return this.args.fullscreen && !this.args.addShowClass; } - get canCreatePost() { - return this.args.model.details?.can_create_post; - } - get createdAt() { return new Date(this.args.model.created_at); } diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs index b07c1d4807b..0148696dc96 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs @@ -94,4 +94,48 @@ + + {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js index bb522a65061..9ed5d571b98 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js @@ -27,7 +27,6 @@ export default class TopicTimelineScrollArea extends Component { @tracked total; @tracked date; @tracked lastReadPercentage = null; - @tracked displayTimeLineScrollArea = true; @tracked before; @tracked after; @tracked timelineScrollareaStyle; @@ -38,15 +37,6 @@ export default class TopicTimelineScrollArea extends Component { super(...arguments); if (!this.args.mobileView) { - const streamLength = this.args.model.postStream?.stream?.length; - - if (streamLength === 1) { - const postsWrapper = document.querySelector(".posts-wrapper"); - if (postsWrapper && postsWrapper.offsetHeight < 1000) { - this.displayTimeLineScrollArea = false; - } - } - // listen for scrolling event to update timeline this.appEvents.on("topic:current-post-scrolled", this.postScrolled); // listen for composer sizing changes to update timeline @@ -58,6 +48,26 @@ export default class TopicTimelineScrollArea extends Component { this.calculatePosition(); } + get displayTimeLineScrollArea() { + if (this.args.mobileView) { + return true; + } + + const streamLength = this.args.model.postStream?.stream?.length; + if (streamLength === 1) { + const postsWrapper = document.querySelector(".posts-wrapper"); + if (postsWrapper && postsWrapper.offsetHeight < 1000) { + return false; + } + } + + return true; + } + + get canCreatePost() { + return this.args.model.details?.can_create_post; + } + get topicTitle() { return htmlSafe(this.args.mobileView ? this.args.model.fancyTitle : ""); }