mirror of
https://github.com/discourse/discourse.git
synced 2025-02-09 20:06:16 +08:00
21 lines
490 B
JavaScript
21 lines
490 B
JavaScript
import { observes } from "ember-addons/ember-computed-decorators";
|
|
|
|
// Mostly hacks because `flag.hbs` didn't use `radio-button`
|
|
export default Ember.Component.extend({
|
|
_selectRadio() {
|
|
this.$("input[type='radio']").prop("checked", false);
|
|
|
|
const nameKey = this.get("nameKey");
|
|
if (!nameKey) {
|
|
return;
|
|
}
|
|
|
|
this.$("#radio_" + nameKey).prop("checked", "true");
|
|
},
|
|
|
|
@observes("nameKey")
|
|
selectedChanged() {
|
|
Ember.run.next(this, this._selectRadio);
|
|
}
|
|
});
|