discourse-solved/assets/javascripts/discourse/initializers/add-topic-list-class.js

19 lines
481 B
JavaScript

import discourseComputed from "discourse-common/utils/decorators";
import TopicListItem from "discourse/components/topic-list-item";
export default {
name: "add-topic-list-class",
initialize() {
TopicListItem.reopen({
@discourseComputed()
unboundClassNames() {
let classList = this._super(...arguments);
if (this.topic.has_accepted_answer) {
classList += " status-solved";
}
return classList;
},
});
},
};