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

This commit is contained in:
Joffrey JAFFEUX 2020-04-28 21:27:07 +02:00 committed by GitHub
parent 9d781d4959
commit 4ecc258835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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) {