mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 15:53:45 +08:00
33 lines
738 B
JavaScript
33 lines
738 B
JavaScript
import Component from "@ember/component";
|
|
import { computed } from "@ember/object";
|
|
import { dasherize } from "@ember/string";
|
|
import { classNames } from "@ember-decorators/component";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
@classNames("embed-setting")
|
|
export default class EmbeddingSetting extends Component {
|
|
@discourseComputed("field")
|
|
inputId(field) {
|
|
return dasherize(field);
|
|
}
|
|
|
|
@discourseComputed("field")
|
|
translationKey(field) {
|
|
return `admin.embedding.${field}`;
|
|
}
|
|
|
|
@discourseComputed("type")
|
|
isCheckbox(type) {
|
|
return type === "checkbox";
|
|
}
|
|
|
|
@computed("value")
|
|
get checked() {
|
|
return !!this.value;
|
|
}
|
|
|
|
set checked(value) {
|
|
this.set("value", value);
|
|
}
|
|
}
|