diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/back-button.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/back-button.hbs index 5f146edd71e..4e58991621e 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/back-button.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/back-button.hbs @@ -2,7 +2,7 @@ @type="button" @class="btn-primary btn-small back-button" @title={{i18n "topic.timeline.back_description"}} - @onClick={{@onClick}} + @action={{@onGoBack}} > {{i18n "topic.timeline.back"}} \ No newline at end of file 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 56f630faa30..baf9cc09920 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs @@ -82,7 +82,7 @@ - {{#if this.hasBackPosition}} + {{#if (and this.hasBackPosition this.showButton)}}
{{d-icon "minus" class="progress"}} - {{#if this.showButton}} - - {{/if}} +
{{/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 9ed5d571b98..3d62f950af1 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.js +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.js @@ -27,6 +27,8 @@ export default class TopicTimelineScrollArea extends Component { @tracked total; @tracked date; @tracked lastReadPercentage = null; + @tracked lastRead; + @tracked lastReadTop; @tracked before; @tracked after; @tracked timelineScrollareaStyle; @@ -171,8 +173,8 @@ export default class TopicTimelineScrollArea extends Component { this.date = date; - const lastReadId = topic.last_read_post_id; const lastReadNumber = topic.last_read_post_number; + const lastReadId = topic.last_read_post_id; if (lastReadId && lastReadNumber) { const idx = postStream.stream.indexOf(lastReadId) + 1; @@ -200,12 +202,6 @@ export default class TopicTimelineScrollArea extends Component { this.before + SCROLLER_HEIGHT - 5 < this.lastReadTop || this.before > this.lastReadTop + 25; } - - if (this.hasBackPosition) { - this.lastReadTop = Math.round( - this.lastReadPercentage * scrollareaHeight() - ); - } } @debounce(50) diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.hbs index 2a666eefedb..2c092052cc8 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/scroller.hbs @@ -18,7 +18,7 @@ {{/if}} {{#if (and @showDockedButton (not @dragging))}} - + {{/if}}
@@ -34,7 +34,7 @@ {{/if}} {{#if (and @showDockedButton (not @dragging))}} - + {{/if}} {{/if}}