PageSourceSearch

https://moyzeska.sk/wp-content/themes/pen/assets/js/pen-navigation-mobile-sticky.js?ver=1.4.3

js moyzeska.sk collected 2026-10-07 03:20:44 UTC 2,258 bytes, 63 lines download raw bytes

1/**
2 * Sticky mobile menu.
3 *
4 * @package Pen
5 */
6
7;( function( $ ) {
8
9	'use strict';
10
11	var $window = $( window ),
12		$body = $( 'body' ),
13		$wpadminbar = $( '#wpadminbar' ),
14		$header = $( '#pen_header' ),
15		$page_wrapper = $( '#page' ).children( '.pen_wrapper' );
16
17	$window.on( 'load resize orientationchange pen_update_sticky_navigation_mobile', function() {
18		var $navigation_mobile = $( '#pen_navigation_mobile' );
19		if ( $navigation_mobile.length ) {
20			var navigation_mobile_top = 0,
21				admin_toolbar_height = 0,
22				header_height = ( $header.css( 'position' ) === 'fixed' ) ? $header.outerHeight( true ) : 0,
23				navigation_mobile_height = $navigation_mobile.removeClass( 'pen_navigation_mobile_sticked' ).outerHeight( true );
24			if ( $wpadminbar.length ) {
25				admin_toolbar_height = $wpadminbar.outerHeight( true );
26			}
27			$navigation_mobile.css( { left: 0, position: 'fixed', top: admin_toolbar_height } );
28
29			$page_wrapper.css( { paddingTop: navigation_mobile_height + header_height } );
30
31			$window.on( 'scroll', function() {
32				if ( $window.scrollTop() ) {
33					var stick = false;
34					if ( pen_navigation_mobile_sticky_js.navigation_mobile === 'always' ) {
35						stick = true;
36					} else if ( pen_function_exists( typeof Modernizr ) ) {
37						var breakpoint = '';
38						if ( pen_navigation_mobile_sticky_js.navigation_mobile === 'mobile' ) {
39							breakpoint = ' and (max-width:728px)';
40						} else if ( pen_navigation_mobile_sticky_js.navigation_mobile === 'tablet' || pen_navigation_mobile_sticky_js.navigation_mobile === 'mobile_tablet' ) {
41							breakpoint = ' and (max-width:1024px)';
42						}
43						if ( breakpoint && Modernizr.mq( 'only all' + breakpoint ) ) {
44							stick = true;
45						}
46					} else {
47						stick = true;
48					}
49					if ( stick ) {
50						$navigation_mobile.css( {
51							top: ( $wpadminbar.css( 'position' ) === 'fixed' ) ? admin_toolbar_height : 0
52						} );
53						$navigation_mobile.addClass( 'pen_navigation_mobile_sticked' );
54						$body.addClass( 'pen_navigation_mobile_sticked' );
55					}
56				} else {
57					$navigation_mobile.removeClass( 'pen_navigation_mobile_sticked' ).css( { top: admin_toolbar_height } );
58					$body.removeClass( 'pen_navigation_mobile_sticked' );
59				}
60			});
61		}
62	});
63})( jQuery );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.