mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 23:13:44 +08:00
fcb1ca52f9
This reverts commit 5ca60fcb6b
.
21 lines
466 B
JavaScript
21 lines
466 B
JavaScript
import Component from "@ember/component";
|
|
import { observes, on } from "ember-addons/ember-computed-decorators";
|
|
|
|
export default Component.extend({
|
|
tagName: "label",
|
|
|
|
click(e) {
|
|
e.preventDefault();
|
|
this.onChange(this.radioValue);
|
|
},
|
|
|
|
@observes("value")
|
|
@on("init")
|
|
updateVal() {
|
|
const checked = this.value === this.radioValue;
|
|
Ember.run.next(
|
|
() => (this.element.querySelector("input[type=radio]").checked = checked)
|
|
);
|
|
}
|
|
});
|