From 76c21734d60e64e6e29a4cfa3eefdba5cc5a542a Mon Sep 17 00:00:00 2001 From: Sergio Gimeno Date: Fri, 22 Sep 2023 19:00:27 +0200 Subject: [PATCH] Apply body styles to mw teleport target Bug: T347199 Change-Id: Ibd5d8c7cc7880678fae498a451cfd417f1f8e1b8 --- resources/skins.vector.js/skin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/skins.vector.js/skin.js b/resources/skins.vector.js/skin.js index cb0501661..9154183a1 100644 --- a/resources/skins.vector.js/skin.js +++ b/resources/skins.vector.js/skin.js @@ -10,7 +10,8 @@ const languageButton = require( './languageButton.js' ), dropdownMenus = require( './dropdownMenus.js' ).dropdownMenus, watchstar = require( './watchstar.js' ).init, setupIntersectionObservers = require( './setupIntersectionObservers.js' ), - menuTabs = require( './menuTabs.js' ); + menuTabs = require( './menuTabs.js' ), + teleportTarget = /** @type {HTMLElement} */require( /** @type {string} */ ( 'mediawiki.page.ready' ) ).teleportTarget; /** * Wait for first paint before calling this function. That's its whole purpose. @@ -97,6 +98,8 @@ function main( window ) { pinnableElement.initPinnableElement(); // Initializes the TOC and sticky header, behaviour of which depend on scroll behaviour. setupIntersectionObservers.main(); + // Apply body styles to teleported elements + teleportTarget.classList.add( 'vector-body' ); } /**