mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 10:05:36 +08:00
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({
|
export default Ember.Component.extend({
|
||||||
tagName : "input",
|
tagName : "input",
|
||||||
type : "radio",
|
type : "radio",
|
||||||
attributeBindings : [ "name", "type", "value", "checked:checked" ],
|
attributeBindings : ["name", "type", "value", "checked:checked", "disabled:disabled"],
|
||||||
|
|
||||||
click : function() {
|
click : function() {
|
||||||
this.set("selection", this.$().val());
|
this.set("selection", this.$().val());
|
||||||
},
|
},
|
||||||
checked : function() {
|
|
||||||
return this.get("value") === this.get("selection");
|
@computed('value', 'selection')
|
||||||
}.property('selection'),
|
checked(value, selection) {
|
||||||
|
return value === selection;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user