Debian Codegraph @

skins/MonoBook/resources/mobile-uls.js

raw symbols SCIP
1 /* eslint-disable no-jquery/no-global-selector */
2 module.exports = function () {
3 mw.loader.using( [ 'ext.uls.interface' ] ).then( function () {
4 var mobileMediaQuery = window.matchMedia( 'screen and (max-width: 550px)' ),
5 $ULSTrigger = $( '#pt-uls' ),
6 ULSMoved = false;
7
8 function moveULS() {
9 if ( $ULSTrigger.length ) {
10 if ( !ULSMoved && mobileMediaQuery.matches ) {
11 $ULSTrigger.insertBefore( $( '#pt-preferences' ) );
12
13 ULSMoved = true;
14 } else if ( ULSMoved && !mobileMediaQuery.matches ) {
15 $ULSTrigger.prepend( $( '#p-preferences' ) );
16
17 ULSMoved = false;
18 }
19 }
20 }
21
22 $( window ).on( 'resize', moveULS );
23 moveULS();
24 } );
25 };