Revert "DEV: Remove usage of {{action}} modifiers (#18333)" (#18469)

This reverts commit ba27ee16376c961c93a4e3854b038a42f9577613.

We found some issues with handling of cmd/ctrl/shift + click on `<a` elements
This commit is contained in:
David Taylor
2022-10-04 12:27:26 +01:00
committed by GitHub
parent ba27ee1637
commit 585c584fdb
135 changed files with 730 additions and 929 deletions

View File

@ -1,7 +1,7 @@
/* global Pikaday:true */
import computed, { observes } from "discourse-common/utils/decorators";
import Component from "@ember/component";
import EmberObject, { action } from "@ember/object";
import EmberObject from "@ember/object";
import I18n from "I18n";
import { INPUT_DELAY } from "discourse-common/config/environment";
import { Promise } from "rsvp";
@ -306,12 +306,6 @@ export default Component.extend({
return dateTime.isValid() ? dateTime.format("LLLL") : emptyText;
},
@action
updateFormat(format, event) {
event?.preventDefault();
this.format = format;
},
actions: {
setTime(event) {
this._setTimeIfValid(event.target.value, "time");

View File

@ -115,7 +115,7 @@
<ul class="formats">
{{#each this.previewedFormats as |previewedFormat|}}
<li class="format">
<a class="moment-format" href {{on "click" (fn this.updateFormat previewedFormat.format)}}>
<a class="moment-format" href {{action (mut this.format) previewedFormat.format}}>
{{previewedFormat.format}}
</a>
<span class="previewed-format">