« MediaWiki:Mobile.js » : différence entre les versions
(Annulation des modifications 101148 de Antoine Mercier-Linteau (discussion)) |
(Ajout code pour Module:Collapsible list) |
||
Ligne 13 : | Ligne 13 : | ||
$(".mw-capiunto-infobox").attr("style", "float: right !important; margin:0.5em 0 0.5em 1em !important; width: 22em !important;") | $(".mw-capiunto-infobox").attr("style", "float: right !important; margin:0.5em 0 0.5em 1em !important; width: 22em !important;") | ||
} | } | ||
// This code goes with Module:Collapsible list. | |||
$(".collapsible-list-toggle").click(function() { | |||
if($(this).html() == '[+]') | |||
{ $(this).html('[-]').prev().fadeIn().prev().toggle(); } | |||
else { $(this).html('[+]').prev().fadeOut().prev().toggle(); } | |||
}); |
Dernière version du 13 mars 2024 à 17:50
/* Le Javascript placé ici n’affectera que les utilisateurs du site mobile */
mw.loader.using('mobile.site.styles'); // See https://phabricator.wikimedia.org/T191596
mw.loader.load( '/index.php?title=MediaWiki:Welcome-modal-dialog.js&action=raw&ctype=text/javascript' );
// Circumvent bug with the main page mask sometimes blocking the whole page and not disappearing.
$(".mw-mf-page-center__mask").click(function() { $(this).hide(); } );
setTimeout(function() { $(".mw-ui-icon-minerva-download").hide(); }, 500); // PDF download is not properly working in mobile.
// Since Mobile.css can't override the default style, it is set here to it's in the element.
if(window.innerWidth > 720) {
$(".mw-capiunto-infobox").attr("style", "float: right !important; margin:0.5em 0 0.5em 1em !important; width: 22em !important;")
}
// This code goes with Module:Collapsible list.
$(".collapsible-list-toggle").click(function() {
if($(this).html() == '[+]')
{ $(this).html('[-]').prev().fadeIn().prev().toggle(); }
else { $(this).html('[+]').prev().fadeOut().prev().toggle(); }
});