This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/radio-button.js.es6
2017-03-28 16:50:35 +08:00

17 lines
409 B
JavaScript

import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
tagName : "input",
type : "radio",
attributeBindings : ["name", "type", "value", "checked:checked", "disabled:disabled"],
click: function() {
this.set("selection", this.$().val());
},
@computed('value', 'selection')
checked(value, selection) {
return value === selection;
},
});