From 6366f9e3eea62b3b370c16f1c7807302403900d0 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Wed, 9 Oct 2024 12:15:37 +0200 Subject: [PATCH] Add a body class when the TOC component is used --- resources/styles/Components/Toc.scss | 2 +- src/Components/Toc.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/styles/Components/Toc.scss b/resources/styles/Components/Toc.scss index 8d59f7d..5ce161d 100644 --- a/resources/styles/Components/Toc.scss +++ b/resources/styles/Components/Toc.scss @@ -127,7 +127,7 @@ // Hide page TOC to prevent page content shift. @include media-breakpoint-up(md) { - #bodyContent #toc { + .has-chameleon-toc #bodyContent #toc { display: none; } } diff --git a/src/Components/Toc.php b/src/Components/Toc.php index 28a4927..b0f282c 100644 --- a/src/Components/Toc.php +++ b/src/Components/Toc.php @@ -47,6 +47,8 @@ public function getHtml(): string { return ''; } + $this->getSkin()->getOutput()->addBodyClasses( 'has-chameleon-toc' ); + // Add Top link. $html = substr_replace( $html, '