jenkins-bot has submitted this change and it was merged.

Change subject: Make all headings with class section-heading toggleable
......................................................................


Make all headings with class section-heading toggleable

The class section-heading allows headings to be collapsed
which aren't direct descendants of the #content div. This is
essential for MobileFrontend's support on Wikidata/Wikibase.
There, <h2> headings are wrapped into other divs for several
reasons but should be collapsible as well.

Bug: T95889
Change-Id: Id6d40a06b662020c2d0f03dc16bf9f23d5436952
---
M javascripts/modules/toggling/init.js
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/javascripts/modules/toggling/init.js 
b/javascripts/modules/toggling/init.js
index d57bf93..d5cc874 100644
--- a/javascripts/modules/toggling/init.js
+++ b/javascripts/modules/toggling/init.js
@@ -200,7 +200,9 @@
                $container = $container || $( '#content' );
 
                $( 'html' ).removeClass( 'stub' );
-               $firstHeading = $container.find( '> h1,> h2,> h3,> h4,> h5,> 
h6' ).eq( 0 );
+               // Also allow .section-heading if some extensions like Wikibase
+               // want to toggle other headlines than direct descendants of 
$container.
+               $firstHeading = $container.find( '> h1,> h2,> h3,> h4,> h5,> 
h6,.section-heading' ).eq( 0 );
                tagName = $firstHeading.prop( 'tagName' ) || 'H1';
 
                if ( collapseSectionsByDefault === undefined ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/203880
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id6d40a06b662020c2d0f03dc16bf9f23d5436952
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bene <[email protected]>
Gerrit-Reviewer: Bene <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Lydia Pintscher <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to