Jump to content

MediaWiki:Mobile.js: Difference between revisions

No edit summary
No edit summary
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
mw.hook( 'wikipage.content' ).add( function ( $content ) {
mw.hook( 'wikipage.content' ).add( function ( $content ) {
    // Trigger Minerva's own toggle handler on any closed heading
$content.find( 'section.collapsible-block[hidden], .collapsible-block[hidden]' ).each( function () {
    $content.find( '.collapsible-heading:not(.open-block)' ).trigger( 'click' );
this.removeAttribute( 'hidden' );
    // Fallback: force hidden section bodies visible
this.style.contentVisibility = 'visible';
    $content.find( '.mf-collapsible-content, .collapsible-block' ).show();
this.style.display = 'block';
} );
$content.find( '.collapsible-heading[aria-expanded="false"]' ).attr( 'aria-expanded', 'true' );
} );
} );