REFACTOR: Allow `radio-button` component to be disabled.
This commit is contained in:
parent
8bf12502bd
commit
874d151c05
|
@ -1,11 +1,16 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName : "input",
|
||||
type : "radio",
|
||||
attributeBindings : [ "name", "type", "value", "checked:checked" ],
|
||||
attributeBindings : ["name", "type", "value", "checked:checked", "disabled:disabled"],
|
||||
|
||||
click : function() {
|
||||
this.set("selection", this.$().val());
|
||||
},
|
||||
checked : function() {
|
||||
return this.get("value") === this.get("selection");
|
||||
}.property('selection'),
|
||||
|
||||
@computed('value', 'selection')
|
||||
checked(value, selection) {
|
||||
return value === selection;
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue