mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Replace onClick props in topic-timeline container (#28342)
Use `on` modifier instead, and set proper href attributes on links
This commit is contained in:
parent
1e3caeafa0
commit
82741eb0a6
@ -2,9 +2,9 @@
|
||||
<div class="title">
|
||||
<h2>
|
||||
<a
|
||||
class="fancy-title"
|
||||
href
|
||||
{{on "click" @jumpTop}}
|
||||
href={{@model.firstPostUrl}}
|
||||
class="fancy-title"
|
||||
>{{this.topicTitle}}</a>
|
||||
</h2>
|
||||
{{#if (or this.siteSettings.topic_featured_link_enabled this.showTags)}}
|
||||
@ -72,9 +72,10 @@
|
||||
<div class="timeline-scrollarea-wrapper">
|
||||
<div class="timeline-date-wrapper">
|
||||
<a
|
||||
class="start-date"
|
||||
onClick={{this.updatePercentage}}
|
||||
{{on "click" this.updatePercentage}}
|
||||
href={{@model.firstPostUrl}}
|
||||
title={{i18n "topic_entrance.jump_top_button_title"}}
|
||||
class="start-date"
|
||||
>
|
||||
<span>
|
||||
{{this.startDate}}
|
||||
@ -87,9 +88,10 @@
|
||||
{{did-insert this.registerScrollarea}}
|
||||
>
|
||||
<div
|
||||
class="timeline-padding"
|
||||
{{! template-lint-disable no-invalid-interactive }}
|
||||
{{on "click" this.updatePercentage}}
|
||||
style={{this.beforePadding}}
|
||||
onClick={{this.updatePercentage}}
|
||||
class="timeline-padding"
|
||||
></div>
|
||||
<TopicTimeline::Scroller
|
||||
@current={{this.current}}
|
||||
@ -104,9 +106,10 @@
|
||||
{{did-insert this.registerScroller}}
|
||||
/>
|
||||
<div
|
||||
class="timeline-padding"
|
||||
{{! template-lint-disable no-invalid-interactive }}
|
||||
{{on "click" this.updatePercentage}}
|
||||
style={{this.afterPadding}}
|
||||
onClick={{this.updatePercentage}}
|
||||
class="timeline-padding"
|
||||
></div>
|
||||
|
||||
{{#if (and this.hasBackPosition this.showButton)}}
|
||||
@ -118,7 +121,11 @@
|
||||
</div>
|
||||
|
||||
<div class="timeline-date-wrapper">
|
||||
<a class="now-date" onClick={{this.updatePercentage}}>
|
||||
<a
|
||||
{{on "click" this.updatePercentage}}
|
||||
href={{@model.lastPostUrl}}
|
||||
class="now-date"
|
||||
>
|
||||
<span>
|
||||
{{age-with-tooltip this.nowDate this.nowDateOptions}}
|
||||
</span>
|
||||
|
@ -308,8 +308,10 @@ export default class TopicTimelineScrollArea extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
@bind
|
||||
@action
|
||||
updatePercentage(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const currentCursorY = e.pageY || e.touches[0].pageY;
|
||||
|
||||
const desiredScrollerCentre = currentCursorY - this.dragOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user