mediawiki-skins-Insurgency/resources/mobile-uls.js
Isarra 406adb14f2 Set mobile width cutoff to 550px
Should avoid more of the issues with unwanted appearance of mobile
layouts. Cutoff results in layout switch when sidebar becomes ~a
third of the total window width.

bug: T196213
Change-Id: I9b8baee5fe53316128f864e732c86750b4e5470e
2018-06-06 21:06:13 +00:00

22 lines
498 B
JavaScript

$( 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 ).resize( moveULS );
moveULS();
} );