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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
668 B
JavaScript
Raw Normal View History

import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import { dasherize } from "@ember/string";
export default Component.extend({
classNames: ["embed-setting"],
@discourseComputed("field")
inputId(field) {
return dasherize(field);
},
@discourseComputed("field")
translationKey(field) {
return `admin.embedding.${field}`;
},
@discourseComputed("type")
isCheckbox(type) {
return type === "checkbox";
},
@discourseComputed("value")
checked: {
get(value) {
return !!value;
},
set(value) {
this.set("value", value);
return value;
},
},
});