mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 04:34:59 +08:00
19 lines
480 B
JavaScript
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);
|
|
}
|
|
});
|