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

Failed to ignore revisions in .git-blame-ignore-revs.

33 lines
624 B
JavaScript
Raw Normal View History

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