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
 
(3 intermediate revisions by the same user not shown)
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 ) {
    // Click any collapsed section headings or remove collapsed classes
alert("hi")
    $content.find( '.collapsible-heading:not(.open-block)' ).each( function () {
$content.find( 'section.collapsible-block[hidden], .collapsible-block[hidden]' ).each( function () {
        $( this ).trigger( 'click' );
this.removeAttribute( 'hidden' );
    } );
this.style.contentVisibility = 'visible';
this.style.display = 'block';
} );
$content.find( '.collapsible-heading[aria-expanded="false"]' ).attr( 'aria-expanded', 'true' );
} );
} );