Debian Codegraph @

skins/Timeless/resources/mobile.js

raw symbols SCIP
1 /* Popout menus (header) */
2
3 /* eslint-disable no-jquery/no-fade */
4
5 $( function () {
6 var toggleTime = 200;
7
8 // Open the various menus
9 $( '#user-tools h2' ).on( 'click', function () {
10 if ( $( window ).width() < 851 ) {
11 $( '#personal-inner, #menus-cover' ).fadeToggle( toggleTime );
12 }
13 } );
14 $( '#site-navigation h2' ).on( 'click', function () {
15 if ( $( window ).width() < 851 ) {
16 $( '#site-navigation .sidebar-inner, #menus-cover' ).fadeToggle( toggleTime );
17 }
18 } );
19 $( '#site-tools h2' ).on( 'click', function () {
20 if ( $( window ).width() < 851 ) {
21 $( '#site-tools .sidebar-inner, #menus-cover' ).fadeToggle( toggleTime );
22 }
23 } );
24 $( '#ca-more' ).on( 'click', function () {
25 $( '#page-tools .sidebar-inner' ).css( 'top', $( '#ca-more' ).offset().top + 25 );
26 if ( $( window ).width() < 851 ) {
27 $( '#page-tools .sidebar-inner, #menus-cover' ).fadeToggle( toggleTime );
28 }
29 } );
30 $( '#ca-languages' ).on( 'click', function () {
31 $( '#other-languages .sidebar-inner' ).css( 'top', $( '#ca-languages' ).offset().top + 25 );
32 if ( $( window ).width() < 851 ) {
33 $( '#other-languages .sidebar-inner, #menus-cover' ).fadeToggle( toggleTime );
34 }
35 } );
36
37 // Close menus on click outside
38 $( document ).on( 'click touchstart', function ( e ) {
39 if ( $( e.target ).closest( '#menus-cover' ).length > 0 ) {
40 $( '#personal-inner' ).fadeOut( toggleTime );
41 $( '.sidebar-inner' ).fadeOut( toggleTime );
42 $( '#menus-cover' ).fadeOut( toggleTime );
43 }
44 } );
45 } );