discourse/app/assets/javascripts/admin/components/embedding-setting.js.es6

32 lines
548 B
Plaintext
Raw Normal View History

2018-06-15 11:03:24 -04:00
import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
2018-06-15 11:03:24 -04:00
classNames: ["embed-setting"],
2018-06-15 11:03:24 -04:00
@computed("field")
inputId(field) {
return field.dasherize();
},
2018-06-15 11:03:24 -04:00
@computed("field")
translationKey(field) {
return `admin.embedding.${field}`;
},
2018-06-15 11:03:24 -04:00
@computed("type")
isCheckbox(type) {
return type === "checkbox";
},
2018-06-15 11:03:24 -04:00
@computed("value")
checked: {
2018-06-15 11:03:24 -04:00
get(value) {
return !!value;
},
set(value) {
2018-06-15 11:03:24 -04:00
this.set("value", value);
return value;
}
}
});