discourse/app/assets/javascripts/wizard/components/radio-button.js.es6
Joffrey JAFFEUX b3eb67976d
DEV: Upgrades to Ember 3.10 (#7871)
Co-Authored-By: majakomel <maja.komel@gmail.com>
2019-07-16 12:45:15 +02:00

20 lines
430 B
JavaScript

import { observes, on } from "ember-addons/ember-computed-decorators";
export default Ember.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)
);
}
});