ember-radio-button
Advanced tools
Comparing version 1.0.0 to 1.0.1
import Ember from 'ember'; | ||
var computed = Ember.computed; | ||
export default Ember.Component.extend({ | ||
tagName: 'label', | ||
classNameBindings: ['checked'], | ||
checked: computed('groupValue', 'value', function(){ | ||
return this.get('groupValue') === this.get('value'); | ||
}).readOnly(), | ||
actions: { | ||
@@ -7,0 +14,0 @@ innerRadioChanged: function(value) { |
@@ -29,2 +29,3 @@ import Ember from 'ember'; | ||
this.set('attributeBindings', updatedAttrs); | ||
this.set('classNameBindings', ['checked']); | ||
} | ||
@@ -31,0 +32,0 @@ }), |
{ | ||
"name": "ember-radio-button", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"directories": { | ||
@@ -22,3 +22,3 @@ "doc": "doc", | ||
"broccoli-asset-rev": "0.3.1", | ||
"ember-cli": "0.1.7", | ||
"ember-cli": "0.2.2", | ||
"ember-cli-content-security-policy": "0.3.0", | ||
@@ -25,0 +25,0 @@ "ember-cli-htmlbars": "^0.6.0", |
@@ -96,2 +96,21 @@ import Ember from 'ember'; | ||
test('it gives the label of a wrapped checkbox a `checked` className', function() { | ||
expect(2); | ||
var component = this.subject({ | ||
groupValue: 'initial-group-value', | ||
value: 'component-value', | ||
template: function() { return 'Blue'; } | ||
}); | ||
this.append(); | ||
equal(component.$().hasClass('checked'), false); | ||
run(function() { | ||
component.set('value', 'initial-group-value'); | ||
}); | ||
equal(component.$().hasClass('checked'), true); | ||
}); | ||
test('it updates when setting `value`', function() { | ||
@@ -98,0 +117,0 @@ expect(3); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55998
56
469