Jump to content

MediaWiki:Mobile.js: Difference between revisions

Created page with "→All JavaScript here will be loaded for users of the mobile site: mw.hook( 'wikipage.content' ).add( function ( $content ) { // Click any collapsed section headings or remove collapsed classes $content.find( '.collapsible-heading:not(.open-block)' ).each( function () { $( this ).trigger( 'click' ); } ); } );"
 
No edit summary
Line 1: Line 1:
/* All JavaScript here will be loaded for users of the mobile site */
/* 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 ) {
     // Click any collapsed section headings or remove collapsed classes
     // Trigger Minerva's own toggle handler on any closed heading
     $content.find( '.collapsible-heading:not(.open-block)' ).each( function () {
     $content.find( '.collapsible-heading:not(.open-block)' ).trigger( 'click' );
        $( this ).trigger( 'click' );
    // Fallback: force hidden section bodies visible
    } );
    $content.find( '.mf-collapsible-content, .collapsible-block' ).show();
} );
} );