Add support for disabled attribute to the d-checkbox component
This commit is contained in:
parent
1103ea7c4c
commit
770efee25f
|
@ -3,9 +3,8 @@ import { on } from "ember-addons/ember-computed-decorators";
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: 'label',
|
tagName: 'label',
|
||||||
|
|
||||||
didInsertElement() {
|
@on("didInsertElement")
|
||||||
this._super();
|
_init() {
|
||||||
|
|
||||||
const checked = this.get('checked');
|
const checked = this.get('checked');
|
||||||
if (checked && checked !== "false") {
|
if (checked && checked !== "false") {
|
||||||
this.$('input').prop('checked', true);
|
this.$('input').prop('checked', true);
|
||||||
|
@ -18,8 +17,7 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
@on('willDestroyElement')
|
@on('willDestroyElement')
|
||||||
willDestroyElement() {
|
_clear() {
|
||||||
this._super();
|
|
||||||
this.$('input').off('click.d-checkbox');
|
this.$('input').off('click.d-checkbox');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<input type='checkbox'>
|
<input type='checkbox' disabled={{disabled}}>
|
||||||
{{i18n label}}
|
{{i18n label}}
|
||||||
|
|
Loading…
Reference in New Issue