discourse-docs/assets/javascripts/discourse/components/docs-topic-list-item.js

25 lines
654 B
JavaScript

import Component from "@ember/component";
import { htmlSafe } from "@ember/template";
import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers";
import { findRawTemplate } from "discourse-common/lib/raw-templates";
export default Component.extend({
tagName: "tr",
classNameBindings: [":topic-list-item"],
didInsertElement() {
this._super(...arguments);
this.renderTopicListItem();
},
renderTopicListItem() {
const template = findRawTemplate("docs-topic-list-item");
if (template) {
this.set(
"topicListItemContents",
htmlSafe(template(this, RUNTIME_OPTIONS))
);
}
},
});