PageSourceSearch

https://support.rometheme.net/wp-content/plugins/eazydocs/assets/js/frontend/global.js?ver=2.14.0

js rometheme.net collected 2026-10-02 05:47:34 UTC 4,676 bytes, 167 lines download raw bytes

1(function ($) {
2	'use strict';
3
4	$(document).ready(function () {
5		/**
6		 * Make the overflow of ancestor Elements to visible of Position Sticky Element
7		 * @type {HTMLElement}
8		 */
9		let parent_selector = document.querySelector('.ezd-sticky-lg-top');
10		if (parent_selector) {
11			let parent = parent_selector.parentElement;
12			while (parent) {
13				const hasOverflow = getComputedStyle(parent).overflow;
14				if (hasOverflow !== 'visible') {
15					parent.style.overflow = 'visible';
16				}
17				parent = parent.parentElement;
18			}
19		}
20
21		$('.body_wrapper').addClass('eazydocs_assistant_body');
22
23		$(window).scroll(function () {
24			$('.doc-book-layout .nav-sidebar li a').filter('.nav-link').index();
25		});
26
27		/**
28		 * Left Sidebar Toggle Icon
29		 */
30		if ($('.doc_documentation_area.fullscreen-layout').length > 0) {
31			let leftSidebarOpen = false;
32
33			$('#mobile-left-toggle').on('click', function (e) {
34				e.preventDefault();
35
36				if (!leftSidebarOpen) {
37					$('.doc_documentation_area.fullscreen-layout').addClass('overlay');
38					$('.fullscreen-layout .doc_mobile_menu.left-column')
39						.addClass('opened')
40						.animate({ left: '0px' }, 300);
41					leftSidebarOpen = true;
42				} else {
43					closeLeftSidebar();
44				}
45			});
46
47			// Close sidebar when clicking outside
48			$(document).on('click', function (e) {
49				if (
50					leftSidebarOpen &&
51					!$(e.target).closest('.doc_mobile_menu.left-column, #mobile-left-toggle').length
52				) {
53					closeLeftSidebar();
54				}
55			});
56
57			function closeLeftSidebar() {
58				$('.doc_documentation_area.fullscreen-layout').removeClass('overlay');
59				$('.fullscreen-layout .doc_mobile_menu.left-column')
60					.removeClass('opened')
61					.animate({ left: '-300px' }, 300);
62				leftSidebarOpen = false;
63			}
64		}
65		
66		/** Modal **/
67		if ($('.modal-toggle').length > 0) {
68			$(document).on('click', '.modal-toggle', function (e) {
69				e.preventDefault();
70				$('.ezd-modal-overlay').fadeIn();
71				let id = $(this).data('id');
72				$('.ezd-modal[data-id="modal' + id + '"]').fadeIn();
73				
74				// if click on esc fadeout it
75				$(document).on('keyup', function (e) {
76					if (e.keyCode === 27) {
77						$('.ezd-modal-overlay').fadeOut();
78						$('.ezd-modal').fadeOut();
79					}
80				});
81				
82			});
83			$(document).on('click', '.ezd-close', function () {
84				$('.ezd-modal-overlay').fadeOut();
85				$('.ezd-modal').fadeOut();
86			});
87			$(document).on('click', '.ezd-modal-overlay', function () {
88				$('.ezd-modal-overlay').fadeOut();
89				$('.ezd-modal').fadeOut();
90			});
91		}
92
93		if ($('#eazydocs-toc a,.book-chapter-nav a').length > 0 && typeof Gumshoe !== 'undefined') {
94			window.ezd_scrollspy = new Gumshoe('#eazydocs-toc a,.book-chapter-nav a', {
95				nested: true,
96			});
97		}
98
99		// Allow ajax-loaded docs to refresh the scrollspy targets later
100		window.ezd_refresh_scrollspy = function () {
101			if (typeof window.ezd_scrollspy !== 'undefined') {
102				window.ezd_scrollspy.setup();
103				window.ezd_scrollspy.detect();
104			} else if ($('#eazydocs-toc a,.book-chapter-nav a').length > 0 && typeof Gumshoe !== 'undefined') {
105				window.ezd_scrollspy = new Gumshoe('#eazydocs-toc a,.book-chapter-nav a', {
106					nested: true,
107				});
108			}
109		};
110		
111		// Masonry [ Doc Archive ]
112		function ezd_masonry_column() {
113
114			var masonryCols = $(".ezd-masonry").attr("ezd-massonry-col");
115			  var masonryColumns = parseInt(masonryCols);
116			
117			if ($(window).width() <= 1024 ) {
118				  var masonryColumns = 2
119			}
120			
121			if ($(window).width() <= 768 ) {
122			  var masonryColumns = 1
123			}
124			
125			var count = 0
126			var content = $(".ezd-masonry > *");
127			
128			$(".ezd-masonry").before("<div class='ezd-masonry-columns'></div>");
129		  
130			content.each(function(index) {
131				count = count + 1
132				$(this).addClass("ezd-masonry-sort-" + count + "")
133		
134				if (count == masonryColumns) {
135					count = 0
136				}
137			});
138			
139			for( var i = 0 + 1; i < masonryColumns + 1 ; i++ ) {
140			  $(".ezd-masonry-columns").append("<div class='ezd-masonry-"+ i +"'></div>");
141			  $(".ezd-masonry-sort-" + i).appendTo(".ezd-masonry-" + i);
142			}
143		  }
144
145		  ezd_masonry_column();
146
147		$('.nav-sidebar.one-page-doc-nav-wrap .nav-item').click(function () {		 
148			$(this).siblings().removeClass('active');
149		});
150		
151    	// Prevent form submission when pressing Enter in the search input field
152		$('#ezd_searchInput').on('keypress', function(event) {
153			if ( eazydocs_local_object.ezd_search_submit != 1 ) {
154				if (event.key === 'Enter') {
155					event.preventDefault(); // Prevent form submission
156				}
157			}
158		});
159		
160		$("label[for=ezd_searchInput]").on("click", function(e) {
161			if ( eazydocs_local_object.ezd_search_submit == 1 ) {
162				$(".ezd_search_form").submit();
163			}
164		});
165		
166	});
167})(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.