MediaWiki:Mobile.js: Difference between revisions

Content deleted Content added
No edit summary
Tags: Mobile edit Mobile web edit
No edit summary
Tags: Mobile edit Mobile web edit
Line 9:
//<nowiki>
let MMCollap = {};
MMCollap.do = function(classes,int $content ) {
console.log('MMCollap.do was called');
/* Outcommented for now, to be revisited later as some people raised potential concerns with providing mobile-only features:
Line 20:
}
}*/
MMCollap.elsmodules = $('.mw-collapsible')[];
MMCollap.els = $content.find( '.mw-collapsible' );
if ( MMCollap.els[0].length ) {
mwMMCollap.loadermodules.usingpush([ 'jquery.makeCollapsible']).then( function () {;
}
if ( MMCollap.modules.length ) {
console.log('collapsible elements were found');
mw.loader.using( MMCollap.modules ).then( function () {
if ( MMCollap.els.length > 1 && ( ['enwiki'].indexOf(mw.config.get('wgDBname')) != -1) ) {
if ( MMCollap.els && MMCollap.els.length ) {
$('.autocollapse').addClass('mw-collapsed'); //the "autocollapse" class is handled by code in Common.js on enwiki, but Common.js isn't loaded on mobile.
mw.loader.addStyleTag('.mw-parser-output .mw-collapsible-toggle{font-weight:normal;min-width:6em}');
}
$(MMCollap.els).makeCollapsible(); //T111565 FTFY
mw.loader.using(['jquery.makeCollapsible']).then( function () {
}
mw.loader.addStyleTag('.mw-parser-output .mw-collapsible-toggle{font-weight:normal;min-width:6em}');
$(MMCollap.els).makeCollapsible(); //T111565 FTFY
});
}
if ( $content[ 0 ] && $content[ 0 ].isConnected === false ) {
mw.log.warn( 'wikipage.content hook should not be fired on unattached content' );
}
};