3bed284b37
Having module definitions living inside SkinMonobook makes them less discoverable. It also shouldn't be necessary - even if there are soft dependencies on other modules. A new file resources/optional-enhancements.js is added which will load the two optional dependencies based on whether they have been installed on the client. Bug: T203023 Change-Id: If9a88db52deb0cc91d58cbb40693d4cd448eabbc
23 lines
622 B
JavaScript
23 lines
622 B
JavaScript
/* eslint-disable no-jquery/no-global-selector */
|
|
mw.loader.using( [ 'ext.uls.interface' ] ).then( function () {
|
|
var mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ),
|
|
$ULSTrigger = $( '#pt-uls' ),
|
|
ULSMoved = false;
|
|
|
|
function moveULS() {
|
|
if ( $ULSTrigger.length ) {
|
|
if ( !ULSMoved && mobileMediaQuery.matches ) {
|
|
$ULSTrigger.insertBefore( $( '#pt-preferences' ) );
|
|
|
|
ULSMoved = true;
|
|
} else if ( ULSMoved && !mobileMediaQuery.matches ) {
|
|
$ULSTrigger.prepend( $( '#p-preferences' ) );
|
|
|
|
ULSMoved = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
$( window ).on( 'resize', moveULS );
|
|
moveULS();
|
|
} );
|