diff --git a/resources/skins.citizen.scripts/sections.js b/resources/skins.citizen.scripts/sections.js index 5327b8d2f..009d6c2a7 100644 --- a/resources/skins.citizen.scripts/sections.js +++ b/resources/skins.citizen.scripts/sections.js @@ -55,11 +55,11 @@ function init( bodyContent ) { const heading = target.closest( '.citizen-section-heading' ); if ( heading ) { - const i = +heading.getAttribute( 'data-mw-citizen-section-heading-index' ); const headline = heading.querySelector( '.mw-headline' ) || heading.querySelector( '.mw-heading' ); if ( headline ) { + const i = +headline.getAttribute( 'data-mw-citizen-section-heading-index' ); toggleClasses( i ); toggleAriaExpanded( headline ); }