mirror of
https://github.com/discourse/discourse.git
synced 2024-12-11 17:05:47 +08:00
18 lines
438 B
Plaintext
18 lines
438 B
Plaintext
|
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));
|
||
|
}
|
||
|
});
|