discourse/app/assets/javascripts/wizard/components/radio-button.js.es6

18 lines
438 B
Plaintext
Raw Normal View History

2016-09-10 03:57:44 +08:00
import { observes, on } from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({
tagName: 'label',
click(e) {
e.preventDefault();
this.sendAction('onChange', this.get('radioValue'));
},
@observes('value')
@on('init')
updateVal() {
const checked = this.get('value') === this.get('radioValue');
Ember.run.next(() => this.$('input[type=radio]').prop('checked', checked));
}
});