MediaWiki:Common.js: Difference between revisions

Test directionally for Arabic
(Updates from https://en.wikipedia.org/wiki/MediaWiki:Common.js. Should we use mw.loader.using? I'm going to test and see if it all works)
(Test directionally for Arabic)
Line 218: Line 218:
}
}


mw.hook( 'wikipage.content' ).add( createNavigationBarToggleButton );
/* text directionality */
mw.hook( 'wikipage.content' ).add( function ( $content ) {
    if(mw.config.get('wgTitle').startsWith('ar/') ||  mw.config.get('wgTitle').startsWith('Ar/') ){
        $content.find( '#mw-content-text' )
            .removeClass( 'mw-content-ltr' )
            .addClass( 'mw-content-rtl' );
    }
} );