mirror of
https://github.com/discourse/discourse.git
synced 2025-06-08 00:17:19 +08:00
DEV: adds support for header-title in topicTitleDecorators (#9562)
This commit is contained in:
@ -7,6 +7,7 @@ import PanEvents, {
|
|||||||
SWIPE_DISTANCE_THRESHOLD,
|
SWIPE_DISTANCE_THRESHOLD,
|
||||||
SWIPE_VELOCITY_THRESHOLD
|
SWIPE_VELOCITY_THRESHOLD
|
||||||
} from "discourse/mixins/pan-events";
|
} from "discourse/mixins/pan-events";
|
||||||
|
import { topicTitleDecorators } from "discourse/components/topic-title";
|
||||||
|
|
||||||
const PANEL_BODY_MARGIN = 30;
|
const PANEL_BODY_MARGIN = 30;
|
||||||
|
|
||||||
@ -260,6 +261,13 @@ const SiteHeaderComponent = MountWidget.extend(Docking, PanEvents, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
afterRender() {
|
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");
|
const $menuPanels = $(".menu-panel");
|
||||||
if ($menuPanels.length === 0) {
|
if ($menuPanels.length === 0) {
|
||||||
if (this.site.mobileView) {
|
if (this.site.mobileView) {
|
||||||
|
Reference in New Issue
Block a user