PageSourceSearch

http://www.aytorasines.org/wp-content/plugins/jet-menu/assets/public/js/jet-menu-widgets-scripts.js?ver=1.5.8

js aytorasines.org collected 2026-10-02 20:25:00 UTC 9,554 bytes, 242 lines download raw bytes

1( function( $, elementor ) {
2
3	"use strict";
4
5	var JetMenuWidget = {
6
7		init: function() {
8
9			var widgets = {
10				'jet-mega-menu.default' : JetMenuWidget.widgetMegaMenu,
11				'jet-custom-menu.default' : JetMenuWidget.widgetCustomMenu
12			};
13
14			$.each( widgets, function( widget, callback ) {
15				elementor.hooks.addAction( 'frontend/element_ready/' + widget, callback );
16			});
17
18		},
19
20		widgetMegaMenu: function( $scope ) {
21			var $target                  = $scope.find( '.jet-menu-container' ),
22				rollUp                   = false,
23				jetMenuMouseleaveDelay   = 500,
24				jetMenuMegaWidthType     = 'container',
25				jetMenuMegaWidthSelector = '',
26				jetMenuMegaOpenSubType   = 'hover',
27				jetMenuMobileBreakpoint  = 768;
28
29			if ( window.jetMenuPublicSettings && window.jetMenuPublicSettings.menuSettings ) {
30				rollUp                   = ( 'true' === jetMenuPublicSettings.menuSettings.jetMenuRollUp ) ? true : false;
31				jetMenuMouseleaveDelay   = jetMenuPublicSettings.menuSettings.jetMenuMouseleaveDelay || 500;
32				jetMenuMegaWidthType     = jetMenuPublicSettings.menuSettings.jetMenuMegaWidthType || 'container';
33				jetMenuMegaWidthSelector = jetMenuPublicSettings.menuSettings.jetMenuMegaWidthSelector || '';
34				jetMenuMegaOpenSubType   = jetMenuPublicSettings.menuSettings.jetMenuMegaOpenSubType || 'hover';
35				jetMenuMobileBreakpoint  = jetMenuPublicSettings.menuSettings.jetMenuMobileBreakpoint || 768;
36			}
37
38			$target.JetMenu( {
39				enabled: rollUp,
40				mouseLeaveDelay: +jetMenuMouseleaveDelay,
41				megaWidthType: jetMenuMegaWidthType,
42				megaWidthSelector: jetMenuMegaWidthSelector,
43				openSubType: jetMenuMegaOpenSubType,
44				threshold: +jetMenuMobileBreakpoint
45			} );
46		},
47
48		widgetCustomMenu: function( $scope ) {
49			var $target = $scope.find( '.jet-custom-nav' ),
50				instance = null,
51				menuItem = null;
52
53			if ( ! $target.length ) {
54				return;
55			}
56
57			if ( JetMenuWidget.mobileAndTabletcheck() ) {
58				$scope.on( 'touchstart', '.jet-custom-nav__item > a', touchStartItem );
59				$scope.on( 'touchend', '.jet-custom-nav__item > a', touchEndItem );
60			} else {
61				$scope.on( 'mouseenter mouseover', '.jet-custom-nav__item', mouseEnterHandler );
62				$scope.on( 'mouseleave', '.jet-custom-nav__item', mouseLeaveHandler );
63			}
64
65			function mouseEnterHandler( event ) {
66				menuItem = $( event.target ).parents( '.jet-custom-nav__item' );
67				menuItem.addClass( 'hover-state' );
68			}
69
70			function mouseLeaveHandler( event ) {
71				menuItem = $( event.target ).parents( '.jet-custom-nav__item' );
72				menuItem.removeClass( 'hover-state' );
73			}
74
75			function touchStartItem( event ) {
76				var $this = $( event.currentTarget ).closest( '.jet-custom-nav__item' );
77
78				$this.data( 'offset', $this.offset().top );
79				$this.data( 'windowOffset', $( window ).scrollTop() );
80			}
81
82			function touchEndItem( event ) {
83				var $this,
84					$siblingsItems,
85					$link,
86					subMenu,
87					offset,
88					windowOffset;
89
90				event.preventDefault();
91				event.stopPropagation();
92
93				$this          = $( event.currentTarget ).closest( '.jet-custom-nav__item' );
94				$siblingsItems = $this.siblings( '.jet-custom-nav__item.menu-item-has-children' );
95				$link          = $( '> a', $this );
96				subMenu        = $( '.jet-custom-nav__sub:first, .jet-custom-nav__mega-sub:first', $this );
97				offset         = $this.data( 'offset' );
98				windowOffset   = $this.data( 'windowOffset' );
99
100				if ( offset !== $this.offset().top || windowOffset !== $( window ).scrollTop() ) {
101					return false;
102				}
103
104				if ( $siblingsItems[0] ) {
105					$siblingsItems.removeClass( 'hover-state' );
106					$( '.menu-item-has-children', $siblingsItems ).removeClass( 'hover-state' );
107				}
108
109				if ( ! $( '.jet-custom-nav__sub, .jet-custom-nav__mega-sub', $this )[0] || $this.hasClass( 'hover-state' ) ) {
110					window.location = $link.attr( 'href' );
111
112					return false;
113				}
114
115				if ( subMenu[0] ) {
116					$this.addClass( 'hover-state' );
117				}
118			}
119
120			var initSubMenuPosition = false;
121
122			function setSubMenuPosition(){
123				if ( initSubMenuPosition ) {
124					$target.find( '.jet-custom-nav__sub.inverse-side' ).removeClass( 'inverse-side' );
125					initSubMenuPosition = false;
126				}
127
128				var subMenu  = $( '.jet-custom-nav__sub', $target ),
129					$body    = $( 'body' ),
130					maxWidth = $body.outerWidth( true ),
131					isMobile = 'mobile' === elementor.getCurrentDeviceMode();
132
133				if ( isMobile ) {
134					return;
135				}
136
137				if ( subMenu[0] ) {
138					subMenu.each( function() {
139						var $this = $( this ),
140							subMenuOffsetLeft = $this.offset().left,
141							subMenuOffsetRight = subMenuOffsetLeft + $this.outerWidth( true ),
142							subMenuPosition = $this.closest( '.jet-custom-nav' ).hasClass( 'jet-custom-nav--dropdown-left-side' ) ? 'left-side' : 'right-side';
143
144						if ( 'right-side' === subMenuPosition ) {
145							if ( subMenuOffsetRight >= maxWidth ) {
146								$this.addClass( 'inverse-side' );
147								$this.find( '.jet-custom-nav__sub' ).addClass( 'inverse-side' );
148
149								initSubMenuPosition = true;
150							} else if ( subMenuOffsetLeft < 0 ) {
151								$this.removeClass( 'inverse-side' );
152								$this.find( '.jet-custom-nav__sub' ).removeClass( 'inverse-side' );
153							}
154						} else {
155							if ( subMenuOffsetLeft < 0 ) {
156								$this.addClass( 'inverse-side' );
157								$this.find( '.jet-custom-nav__sub' ).addClass( 'inverse-side' );
158
159								initSubMenuPosition = true;
160							} else if ( subMenuOffsetRight >= maxWidth ) {
161								$this.removeClass( 'inverse-side' );
162								$this.find( '.jet-custom-nav__sub' ).removeClass( 'inverse-side' );
163							}
164						}
165					} );
166				}
167			}
168
169			setSubMenuPosition();
170			$( window ).on( 'resize.JetCustomMenu orientationchange.JetCustomMenu', setSubMenuPosition );
171
172			var initMaxMegaMenuWidth = false;
173
174			function setMaxMegaMenuWidth(){
175				var megaMenu = $( '.jet-custom-nav__mega-sub', $target ),
176					$body    = $( 'body' ),
177					maxWidth = $body.outerWidth( true ),
178					isMobile = 'mobile' === elementor.getCurrentDeviceMode();
179
180				if ( initMaxMegaMenuWidth ) {
181					megaMenu.css( {
182						'maxWidth': ''
183					} );
184
185					initMaxMegaMenuWidth = false;
186				}
187
188				if ( isMobile ) {
189					return;
190				}
191
192				if ( megaMenu[0] ) {
193					megaMenu.each( function() {
194						var $this = $( this ),
195							megaMenuTranslateX = $this.css( 'transform' ).replace( /,/g, "" ).split( " " )[4] || 0,
196							megaMenuOffsetLeft = $this.offset().left - megaMenuTranslateX,
197							megaMenuOffsetRight = megaMenuOffsetLeft + $this.outerWidth( true ),
198							megaMenuPosition = $this.closest( '.jet-custom-nav' ).hasClass( 'jet-custom-nav--dropdown-left-side' ) ? 'left-side' : 'right-side';
199
200						if ( 'right-side' === megaMenuPosition ) {
201							if ( megaMenuOffsetRight >= maxWidth ) {
202								$this.css({
203									'maxWidth': maxWidth - megaMenuOffsetLeft - 10
204								});
205
206								initMaxMegaMenuWidth = true;
207							}
208						} else {
209							if ( megaMenuOffsetLeft < 0 ) {
210								$this.css({
211									'maxWidth': megaMenuOffsetRight - 10
212								});
213
214								initMaxMegaMenuWidth = true;
215							}
216						}
217					} );
218				}
219			}
220
221			setMaxMegaMenuWidth();
222			$( window ).on( 'resize.JetCustomMenu orientationchange.JetCustomMenu', setMaxMegaMenuWidth );
223
224		},
225
226		/**
227		 * Mobile and tablet check funcion.
228		 *
229		 * @return {boolean} Mobile Status
230		 */
231		mobileAndTabletcheck: function() {
232			var check = false;
233
234			(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
234sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);
235
236			return check;
237		}
238	};
239
240	$( window ).on( 'elementor/frontend/init', JetMenuWidget.init );
241
242}( jQuery, window.elementorFrontend ) );

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.