2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-10-24 00:30:52 +08:00
|
|
|
import Component from "@ember/component";
|
2015-08-21 01:43:12 +08:00
|
|
|
|
2019-10-24 00:30:52 +08:00
|
|
|
export default Component.extend({
|
2015-08-21 01:43:12 +08:00
|
|
|
classNames: ["embed-setting"],
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("field")
|
2015-08-21 01:43:12 +08:00
|
|
|
inputId(field) {
|
|
|
|
return field.dasherize();
|
|
|
|
},
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("field")
|
2015-08-21 01:43:12 +08:00
|
|
|
translationKey(field) {
|
|
|
|
return `admin.embedding.${field}`;
|
|
|
|
},
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("type")
|
2015-08-21 01:43:12 +08:00
|
|
|
isCheckbox(type) {
|
|
|
|
return type === "checkbox";
|
|
|
|
},
|
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("value")
|
2015-08-21 01:43:12 +08:00
|
|
|
checked: {
|
|
|
|
get(value) {
|
|
|
|
return !!value;
|
|
|
|
},
|
|
|
|
set(value) {
|
2015-10-11 20:48:37 +08:00
|
|
|
this.set("value", value);
|
2015-08-21 01:43:12 +08:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|