discourse/app/assets/javascripts/discourse/components/flag-selection.js.es6
2018-06-15 17:03:24 +02:00

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);
}
});