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({
|
2018-06-15 23:03:24 +08:00
|
|
|
classNames: ["embed-setting"],
|
2015-08-21 01:43:12 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("field")
|
2018-06-15 23:03:24 +08:00
|
|
|
inputId(field) {
|
|
|
|
return field.dasherize();
|
|
|
|
},
|
2015-08-21 01:43:12 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("field")
|
2018-06-15 23:03:24 +08:00
|
|
|
translationKey(field) {
|
|
|
|
return `admin.embedding.${field}`;
|
|
|
|
},
|
2015-08-21 01:43:12 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("type")
|
2018-06-15 23:03:24 +08:00
|
|
|
isCheckbox(type) {
|
|
|
|
return type === "checkbox";
|
|
|
|
},
|
2015-08-21 01:43:12 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("value")
|
2015-08-21 01:43:12 +08:00
|
|
|
checked: {
|
2018-06-15 23:03:24 +08:00
|
|
|
get(value) {
|
|
|
|
return !!value;
|
|
|
|
},
|
2015-08-21 01:43:12 +08:00
|
|
|
set(value) {
|
2018-06-15 23:03:24 +08:00
|
|
|
this.set("value", value);
|
2015-08-21 01:43:12 +08:00
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|