A platform for community discussion. Free, open, simple.
Revert "DEV: Use `on` modifier (or `@action` param) (#28323)" (#28338)
Jarek Radosz355dbb928a2b
diff --git a/app/assets/javascripts/admin/addon/components/admin-watched-word.hbs b/app/assets/javascripts/admin/addon/components/admin-watched-word.hbsindex 2a609c270aa..8af02f51571 100644--- a/app/assets/javascripts/admin/addon/components/admin-watched-word.hbs+++ b/app/assets/javascripts/admin/addon/components/admin-watched-word.hbs@@ -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}}diff --git a/app/assets/javascripts/discourse/app/components/expand-post.hbs b/app/assets/javascripts/discourse/app/components/expand-post.hbsindex 8392b2d93a5..d183a9c3115 100644--- a/app/assets/javascripts/discourse/app/components/expand-post.hbs+++ b/app/assets/javascripts/discourse/app/components/expand-post.hbs@@ -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"}}diff --git a/app/assets/javascripts/discourse/app/components/software-update-prompt.hbs b/app/assets/javascripts/discourse/app/components/software-update-prompt.hbsindex 9a38e979212..7e5d4af96e3 100644--- a/app/assets/javascripts/discourse/app/components/software-update-prompt.hbs+++ b/app/assets/javascripts/discourse/app/components/software-update-prompt.hbs@@ -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"><spanaria-label={{i18n "software_update_prompt.dismiss"}}role="button"- {{on "click" this.dismiss}}+ onclick={{action "dismiss"}}>{{d-icon "times"}}</span></span></div></div>diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbsindex 7baa7b8593d..f400aad3130 100644--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs@@ -2,9 +2,9 @@<div class="title"><h2><a- {{on "click" @jumpTop}}- hrefclass="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"}}diff --git a/app/assets/javascripts/discourse/app/components/user-status-picker.hbs b/app/assets/javascripts/discourse/app/components/user-status-picker.hbsindex 8dc92ab3458..0a526547e08 100644--- a/app/assets/javascripts/discourse/app/components/user-status-picker.hbs+++ b/app/assets/javascripts/discourse/app/components/user-status-picker.hbs@@ -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}}diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjsindex 25fe40a8cf8..43f67c5beec 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-option-ranked-choice.gjs@@ -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>diff --git a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjsindex 79318a1cc0b..42043a39790 100644--- a/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs+++ b/plugins/poll/assets/javascripts/discourse/components/poll-options.gjs@@ -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"}}