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
{{on "click" this.deleteWord}}
role="button"
onclick={{this.deleteWord}}
class="delete-word-record"
>{{d-icon "times"}}</span>
{{this.word.word}}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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