discourse/app/assets/javascripts/admin/components/embedding-setting.js.es6
2018-06-15 17:03:24 +02:00

32 lines
548 B
JavaScript

import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
classNames: ["embed-setting"],
@computed("field")
inputId(field) {
return field.dasherize();
},
@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;
}
}
});