PluginProbe
Easy Elements for Elementor – Addons & Website Templates / 1.5.0
Easy Elements for Elementor – Addons & Website Templates v1.5.0
1.5.3 1.5.2 1.5.1 1.5.0 1.4.9 1.4.6 1.4.7 1.4.8 1.4.5 1.4.4 1.4.3 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 All 47 releases
easy-elements / widgets / team-grid / js / team.js

team.js in Easy Elements for Elementor – Addons & Website Templates 1.5.0, at widgets/team-grid/js/team.js

59 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function($) {
2 "use strict";
3
4 function initTeamPopup($scope) {
5 // Initialize popup triggers
6 $scope.find('.eel-popup-trigger').off('click').on('click', function(e) {
7 e.preventDefault();
8 e.stopPropagation();
9 var popupId = $(this).data('popup-id');
10 var modal = document.getElementById(popupId);
11 if(modal) {
12 modal.style.display = 'block';
13 // Add active class for better styling
14 $(modal).addClass('active');
15 // Prevent body scroll
16 $('body').addClass('eel-popup-open');
17 }
18 });
19
20 // Initialize close buttons
21 $scope.find('.eel-popup-close').off('click').on('click', function(e) {
22 e.preventDefault();
23 e.stopPropagation();
24 var modal = $(this).closest('.eel-popup-modal');
25 modal.hide().removeClass('active');
26 $('body').removeClass('eel-popup-open');
27 });
28
29 // Close on background click
30 $(document).off('click.eelPopup').on('click.eelPopup', function(e) {
31 if ($(e.target).hasClass('eel-popup-modal')) {
32 $(e.target).hide().removeClass('active');
33 $('body').removeClass('eel-popup-open');
34 }
35 });
36
37 // Close on escape key
38 $(document).off('keydown.eelPopup').on('keydown.eelPopup', function(e) {
39 if (e.key === 'Escape' || e.keyCode === 27) {
40 $('.eel-popup-modal.active').hide().removeClass('active');
41 $('body').removeClass('eel-popup-open');
42 }
43 });
44 }
45
46 // Initialize on Elementor frontend
47 $(window).on('elementor/frontend/init', function () {
48 elementorFrontend.hooks.addAction('frontend/element_ready/eel-team-grid.default', initTeamPopup);
49 });
50
51 // Also initialize on document ready for non-Elementor pages
52 $(document).ready(function() {
53 if (typeof elementorFrontend === 'undefined') {
54 initTeamPopup($('body'));
55 }
56 });
57
58 })(jQuery);
59