Skip to content

A platform for community discussion. Free, open, simple.

DEV: adds support for header-title in topicTitleDecorators (#9562)

Joffrey JAFFEUX4ecc25883549
diff --git a/app/assets/javascripts/discourse/app/components/site-header.js b/app/assets/javascripts/discourse/app/components/site-header.js
index e110b9ceeea..ec7084b8153 100644
--- a/app/assets/javascripts/discourse/app/components/site-header.js
+++ b/app/assets/javascripts/discourse/app/components/site-header.js
@@ -7,6 +7,7 @@ import PanEvents, {
SWIPE_DISTANCE_THRESHOLD,
SWIPE_VELOCITY_THRESHOLD
} from "discourse/mixins/pan-events";
+import { topicTitleDecorators } from "discourse/components/topic-title";
const PANEL_BODY_MARGIN = 30;
@@ -260,6 +261,13 @@ const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
},
afterRender() {
+ const headerTitle = document.querySelector(".header-title .topic-link");
+ if (headerTitle && this._topic) {
+ topicTitleDecorators.forEach(cb =>
+ cb(this._topic, headerTitle, "header-title")
+ );
+ }
+
const $menuPanels = $(".menu-panel");
if ($menuPanels.length === 0) {
if (this.site.mobileView) {