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

Change subject: Fix toggling when level 0 sections are used
......................................................................


Fix toggling when level 0 sections are used

Toggling should always use the "highest" heading, which is, maybe, not the first
one.

Bug: T88885
Change-Id: Ib3d1e1c038c374194fffedd3f8dfbde1a42fd3c3
---
M javascripts/modules/toggling/init.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/javascripts/modules/toggling/init.js 
b/javascripts/modules/toggling/init.js
index 7ae88c8..286612d 100644
--- a/javascripts/modules/toggling/init.js
+++ b/javascripts/modules/toggling/init.js
@@ -199,7 +199,7 @@
                $container = $container || $( '#content' );
 
                $( 'html' ).removeClass( 'stub' );
-               $firstHeading = $container.find( 'h1,h2,h3,h4,h5,h6' ).eq( 0 );
+               $firstHeading = $container.find( '> h1,> h2,> h3,> h4,> h5,> 
h6' ).eq( 0 );
                tagName = $firstHeading.prop( 'tagName' ) || 'H1';
 
                if ( collapseSectionsByDefault === undefined ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3d1e1c038c374194fffedd3f8dfbde1a42fd3c3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to