mediawiki-skins-Insurgency/resources/mobile-uls.js

24 lines
551 B
JavaScript
Raw Normal View History

/* eslint-disable jquery/no-global-selector */
$( function () {
var mobileCutoffWidth = 550,
ULSTrigger = $( '#pt-uls' ),
ULSMoved = false;
function moveULS() {
if ( ULSTrigger.length ) {
if ( !ULSMoved && $( window ).width() <= mobileCutoffWidth ) {
ULSTrigger.insertBefore( $( '#pt-preferences' ) );
ULSMoved = true;
} else if ( ULSMoved && $( window ).width() > mobileCutoffWidth ) {
ULSTrigger.prepend( $( '#p-preferences' ) );
ULSMoved = false;
}
}
}
$( window ).on( 'resize', moveULS );
moveULS();
} );