mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 05:02:24 +08:00
b3eb67976d
Co-Authored-By: majakomel <maja.komel@gmail.com>
20 lines
430 B
JavaScript
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)
|
|
);
|
|
}
|
|
});
|