A platform for community discussion. Free, open, simple.
DEV: Add class to header-topic-info widget (#9475)
Mark VanLandinghame5233f5ce69a
diff --git a/app/assets/javascripts/discourse/widgets/header-topic-info.js b/app/assets/javascripts/discourse/widgets/header-topic-info.jsindex c6488d05629..1e31cf5fbfa 100644--- a/app/assets/javascripts/discourse/widgets/header-topic-info.js+++ b/app/assets/javascripts/discourse/widgets/header-topic-info.js@@ -57,6 +57,10 @@ createWidget("topic-header-participant", {export default createWidget("header-topic-info", {tagName: "div.extra-info-wrapper",+ buildClasses(attrs) {+ return this.showCategory(attrs.topic) ? "two-rows" : "";+ },+buildFancyTitleClass() {const baseClass = ["topic-link"];const flatten = array => [].concat.apply([], array);@@ -112,11 +116,7 @@ export default createWidget("header-topic-info", {const category = topic.get("category");if (loaded || category) {- if (- category &&- (!category.get("isUncategorizedCategory") ||- !this.siteSettings.suppress_uncategorized_badge)- ) {+ if (this.showCategory(topic)) {const parentCategory = category.get("parentCategory");const categories = [];if (parentCategory) {@@ -208,6 +208,14 @@ export default createWidget("header-topic-info", {);},+ showCategory(topic) {+ return (+ topic.category &&+ (!topic.category.isUncategorizedCategory ||+ !this.siteSettings.suppress_uncategorized_badge)+ );+ },+jumpToTopPost() {const topic = this.attrs.topic;if (topic) {