mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 06:25:46 +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({
|
||||
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…
x
Reference in New Issue
Block a user