2019-03-13 18:57:00 -04:00
|
|
|
/* eslint-disable no-jquery/no-global-selector */
|
2021-06-24 12:07:10 -04:00
|
|
|
module.exports = function () {
|
|
|
|
mw.loader.using( [ 'ext.uls.interface' ] ).then( function () {
|
|
|
|
var mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ),
|
|
|
|
$ULSTrigger = $( '#pt-uls' ),
|
|
|
|
ULSMoved = false;
|
2018-05-20 06:29:50 -04:00
|
|
|
|
2021-06-24 12:07:10 -04:00
|
|
|
function moveULS() {
|
|
|
|
if ( $ULSTrigger.length ) {
|
|
|
|
if ( !ULSMoved && mobileMediaQuery.matches ) {
|
|
|
|
$ULSTrigger.insertBefore( $( '#pt-preferences' ) );
|
2018-05-20 06:29:50 -04:00
|
|
|
|
2021-06-24 12:07:10 -04:00
|
|
|
ULSMoved = true;
|
|
|
|
} else if ( ULSMoved && !mobileMediaQuery.matches ) {
|
|
|
|
$ULSTrigger.prepend( $( '#p-preferences' ) );
|
2018-05-20 06:29:50 -04:00
|
|
|
|
2021-06-24 12:07:10 -04:00
|
|
|
ULSMoved = false;
|
|
|
|
}
|
2018-05-20 06:29:50 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-24 12:07:10 -04:00
|
|
|
$( window ).on( 'resize', moveULS );
|
|
|
|
moveULS();
|
|
|
|
} );
|
|
|
|
};
|