discourse/app/assets/javascripts/discourse/components/flag-selection.js.es6
2016-11-14 16:50:46 -05:00

19 lines
480 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);
}
});