Revert "DEV: Use `on` modifier (or `@action` param) (#28323)" (#28338)

This reverts commit e3e5710b3d.
This commit is contained in:
Jarek Radosz 2024-08-13 12:39:24 +02:00 committed by GitHub
parent 9641835743
commit 355dbb928a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 28 additions and 33 deletions

View File

@ -1,6 +1,6 @@
<span <span
{{on "click" this.deleteWord}}
role="button" role="button"
onclick={{this.deleteWord}}
class="delete-word-record" class="delete-word-record"
>{{d-icon "times"}}</span> >{{d-icon "times"}}</span>
{{this.word.word}} {{this.word.word}}

View File

@ -1,9 +1,9 @@
{{#if this.item.truncated}} {{#if this.item.truncated}}
<a <a
{{on "click" (action "toggleItem")}}
href href
title={{i18n "post.expand_collapse"}}
class={{if this.expanded "collapse-item" "expand-item"}} class={{if this.expanded "collapse-item" "expand-item"}}
onclick={{action "toggleItem"}}
title={{i18n "post.expand_collapse"}}
> >
{{#if this.expanded}} {{#if this.expanded}}
{{d-icon "chevron-up"}} {{d-icon "chevron-up"}}

View File

@ -8,15 +8,15 @@
<div class="wrap"> <div class="wrap">
<div class="update-prompt-main-content" aria-live="polite"> <div class="update-prompt-main-content" aria-live="polite">
<span <span
{{on "click" this.refreshPage}}
role="button" role="button"
onclick={{action "refreshPage"}}
class="update-prompt-message" class="update-prompt-message"
>{{d-icon "redo"}} >{{d-icon "redo"}}
{{html-safe (i18n "software_update_prompt.message")}}</span> {{html-safe (i18n "software_update_prompt.message")}}</span>
<span class="update-prompt-dismiss"><span <span class="update-prompt-dismiss"><span
aria-label={{i18n "software_update_prompt.dismiss"}} aria-label={{i18n "software_update_prompt.dismiss"}}
role="button" role="button"
{{on "click" this.dismiss}} onclick={{action "dismiss"}}
>{{d-icon "times"}}</span></span> >{{d-icon "times"}}</span></span>
</div> </div>
</div> </div>

View File

@ -2,9 +2,9 @@
<div class="title"> <div class="title">
<h2> <h2>
<a <a
{{on "click" @jumpTop}}
href
class="fancy-title" class="fancy-title"
href
{{on "click" @jumpTop}}
>{{this.topicTitle}}</a> >{{this.topicTitle}}</a>
</h2> </h2>
{{#if (or this.siteSettings.topic_featured_link_enabled this.showTags)}} {{#if (or this.siteSettings.topic_featured_link_enabled this.showTags)}}
@ -72,10 +72,9 @@
<div class="timeline-scrollarea-wrapper"> <div class="timeline-scrollarea-wrapper">
<div class="timeline-date-wrapper"> <div class="timeline-date-wrapper">
<a <a
{{on "click" this.updatePercentage}}
href
title={{i18n "topic_entrance.jump_top_button_title"}}
class="start-date" class="start-date"
onClick={{this.updatePercentage}}
title={{i18n "topic_entrance.jump_top_button_title"}}
> >
<span> <span>
{{this.startDate}} {{this.startDate}}
@ -88,10 +87,9 @@
{{did-insert this.registerScrollarea}} {{did-insert this.registerScrollarea}}
> >
<div <div
{{! template-lint-disable no-invalid-interactive }}
{{on "click" this.updatePercentage}}
style={{this.beforePadding}}
class="timeline-padding" class="timeline-padding"
style={{this.beforePadding}}
onClick={{this.updatePercentage}}
></div> ></div>
<TopicTimeline::Scroller <TopicTimeline::Scroller
@current={{this.current}} @current={{this.current}}
@ -106,10 +104,9 @@
{{did-insert this.registerScroller}} {{did-insert this.registerScroller}}
/> />
<div <div
{{! template-lint-disable no-invalid-interactive }}
{{on "click" this.updatePercentage}}
style={{this.afterPadding}}
class="timeline-padding" class="timeline-padding"
style={{this.afterPadding}}
onClick={{this.updatePercentage}}
></div> ></div>
{{#if (and this.hasBackPosition this.showButton)}} {{#if (and this.hasBackPosition this.showButton)}}
@ -121,7 +118,7 @@
</div> </div>
<div class="timeline-date-wrapper"> <div class="timeline-date-wrapper">
<a {{on "click" this.updatePercentage}} href class="now-date"> <a class="now-date" onClick={{this.updatePercentage}}>
<span> <span>
{{age-with-tooltip this.nowDate this.nowDateOptions}} {{age-with-tooltip this.nowDate this.nowDateOptions}}
</span> </span>
@ -132,11 +129,10 @@
<div class="timeline-footer-controls"> <div class="timeline-footer-controls">
{{#if this.displaySummary}} {{#if this.displaySummary}}
<button <button
{{! template-lint-disable no-invalid-interactive }}
{{on "click" @showTopReplies}}
type="button" type="button"
title={{i18n "summary.short_title"}}
class="show-summary btn btn-small" class="show-summary btn btn-small"
title={{i18n "summary.short_title"}}
{{on "click" @showTopReplies}}
> >
{{d-icon "layer-group"}} {{d-icon "layer-group"}}
{{i18n "summary.short_label"}} {{i18n "summary.short_label"}}
@ -146,10 +142,10 @@
{{#if (and this.currentUser (not @fullscreen))}} {{#if (and this.currentUser (not @fullscreen))}}
{{#if this.canCreatePost}} {{#if this.canCreatePost}}
<button <button
{{on "click" (fn @replyToPost null)}}
type="button" type="button"
title={{i18n "topic.reply.help"}}
class="btn btn-default create reply-to-post no-text btn-icon" class="btn btn-default create reply-to-post no-text btn-icon"
title={{i18n "topic.reply.help"}}
{{on "click" (fn @replyToPost null)}}
> >
{{d-icon "reply"}} {{d-icon "reply"}}
</button> </button>
@ -158,10 +154,10 @@
{{#if @fullscreen}} {{#if @fullscreen}}
<button <button
{{on "click" @jumpToPostPrompt}}
type="button" type="button"
title={{i18n "topic.progress.jump_prompt_long"}}
class="timeline-open-jump-to-post-prompt-btn btn btn-text jump-to-post" class="timeline-open-jump-to-post-prompt-btn btn btn-text jump-to-post"
title={{i18n "topic.progress.jump_prompt_long"}}
{{on "click" @jumpToPostPrompt}}
> >
<span class="d-button-label"> <span class="d-button-label">
{{i18n "topic.progress.jump_prompt"}} {{i18n "topic.progress.jump_prompt"}}

View File

@ -4,11 +4,11 @@
{{if this.isFocused 'focused'}}" {{if this.isFocused 'focused'}}"
> >
<button <button
{{on "click" this.toggleEmojiPicker}}
{{on "focus" this.focus}}
{{on "blur" this.blur}}
type="button" type="button"
class="btn-emoji btn-transparent" class="btn-emoji btn-transparent"
onclick={{this.toggleEmojiPicker}}
{{on "focus" this.focus}}
{{on "blur" this.blur}}
> >
{{#if @status.emoji}} {{#if @status.emoji}}
{{html-safe this.emojiHtml}} {{html-safe this.emojiHtml}}

View File

@ -4,6 +4,7 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template"; import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button"; import DButton from "discourse/components/d-button";
import routeAction from "discourse/helpers/route-action"; import routeAction from "discourse/helpers/route-action";
import i18n from "discourse-common/helpers/i18n";
import PollOptionRankedChoiceDropdown from "./poll-option-ranked-choice-dropdown"; import PollOptionRankedChoiceDropdown from "./poll-option-ranked-choice-dropdown";
export default class PollOptionsComponent extends Component { export default class PollOptionsComponent extends Component {
@ -29,11 +30,9 @@ export default class PollOptionsComponent extends Component {
@sendRank={{this.sendRank}} @sendRank={{this.sendRank}}
/> />
{{else}} {{else}}
<DButton <DButton class="btn-default" onclick={{routeAction "showLogin"}}>{{i18n
@action={{routeAction "showLogin"}} "poll.options.ranked_choice.login"
@label="poll.options.ranked_choice.login" }}</DButton>
class="btn-default"
/>
{{/if}} {{/if}}
<span class="option-text">{{htmlSafe @option.html}}</span> <span class="option-text">{{htmlSafe @option.html}}</span>
</div> </div>

View File

@ -59,7 +59,7 @@ export default class PollOptionsComponent extends Component {
<span class="option-text">{{htmlSafe option.html}}</span> <span class="option-text">{{htmlSafe option.html}}</span>
</button> </button>
{{else}} {{else}}
<button {{on "click" (routeAction "showLogin")}}> <button onclick={{routeAction "showLogin"}}>
{{#if (this.isChosen option)}} {{#if (this.isChosen option)}}
{{#if @isCheckbox}} {{#if @isCheckbox}}
{{icon "far-check-square"}} {{icon "far-check-square"}}