Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/189239

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/39/189239/1

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: newchange
Gerrit-Change-Id: Ib3d1e1c038c374194fffedd3f8dfbde1a42fd3c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

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

Reply via email to