mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 01:24:03 +08:00
a433b30650
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
34 lines
748 B
JavaScript
34 lines
748 B
JavaScript
import { classNames } from "@ember-decorators/component";
|
|
import { computed } from "@ember/object";
|
|
import Component from "@ember/component";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import { dasherize } from "@ember/string";
|
|
|
|
@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(value) {
|
|
this.set("value", value);
|
|
return value;
|
|
}
|
|
}
|