2015-08-20 13:43:12 -04:00
|
|
|
import computed from 'ember-addons/ember-computed-decorators';
|
|
|
|
|
|
|
|
export default Ember.Component.extend({
|
|
|
|
classNames: ['embed-setting'],
|
|
|
|
|
|
|
|
@computed('field')
|
|
|
|
inputId(field) { return field.dasherize(); },
|
|
|
|
|
2015-09-23 12:10:15 -04:00
|
|
|
@computed('placeholder')
|
|
|
|
placeholderValue(placeholder) {
|
|
|
|
return placeholder ? I18n.t(placeholder) : null;
|
|
|
|
},
|
|
|
|
|
2015-08-20 13:43:12 -04:00
|
|
|
@computed('field')
|
|
|
|
translationKey(field) { return `admin.embedding.${field}`; },
|
|
|
|
|
|
|
|
@computed('type')
|
|
|
|
isCheckbox(type) { return type === "checkbox"; },
|
|
|
|
|
|
|
|
@computed('value')
|
|
|
|
checked: {
|
|
|
|
get(value) { return !!value; },
|
|
|
|
set(value) {
|
|
|
|
this.set('value', value);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|