PageSourceSearch

https://european-accreditation.org/wp-content/plugins/thegem-eleme…/assets/js/thegem-portfolio-carousel.js

js european-accreditation.org collected 2026-09-24 08:52:54 UTC 3,819 bytes, 126 lines download raw bytes

1(function ($) {
2	function initPortfolioCarousel() {
3		if (window.tgpLazyItems !== undefined) {
4			var isShowed = window.tgpLazyItems.checkGroupShowed(this, function (node) {
5				initPortfolioCarousel.call(node);
6			});
7			if (!isShowed) {
8				return;
9			}
10		}
11
12		var $portfolio = $(this);
13		var $galleryElement = $('.portfolio-set', $portfolio);
14
15		var isTouch = window.gemSettings.isTouch,
16			autoplay = true,
17			animationSpeed = $portfolio.attr("data-autoscroll-speed"),
18			slideBy = 'page',
19			animationEffect = $portfolio.attr("data-sliding-animation"),
20			isArrows = $portfolio.attr("data-arrows") === '1',
21			isDots = $portfolio.attr("data-dots") === '1',
22			isLoop = $portfolio.attr("data-loop") === '1',
23			$carouselItem = $('.extended-carousel-item', $galleryElement);
24
25		if (animationSpeed == '0') {
26			autoplay = false
27		}
28
29		if (animationEffect == 'one-by-one') {
30			slideBy = 1
31		}
32
33		//Init preview carousel
34		$carouselItem.owlCarousel({
35			loop: isLoop,
36			items: 1,
37			rewind: false,
38			mouseDrag: true,
39			autoplay: autoplay,
40			autoplayTimeout: animationSpeed,
41			slideTransition: 'ease',
42			slideBy: slideBy,
43			dots: isDots,
44			nav: isArrows,
45			navElement: 'button type="button" aria-label="Navigation Arrow"',
46			responsive: {
47				0: {
48					items: $portfolio.data('columns-mobile'),
49					margin: $portfolio.data("margin-mobile"),
50				},
51				768: {
52					items: $portfolio.data('columns-tablet'),
53					margin: $portfolio.data("margin-tablet"),
54				},
55				992: {
56					items: $portfolio.data('columns-desktop'),
57					margin: $portfolio.data("margin-desktop"),
58				},
59			},
60			onRefreshed: function () {
61				if ($portfolio.hasClass('loading-animation') && $portfolio.hasClass('animation-update')) {
62					$portfolio.removeClass('animation-update');
63					if ($portfolio.itemsAnimations('instance').getAnimationName() != 'disabled') {
64						$portfolio.itemsAnimations('instance').reinitItems($('.portfolio-item', $portfolio));
65						$portfolio.itemsAnimations('instance').show($('.portfolio-item', $portfolio));
66					}
67				}
68			},
69			onInitialized: function () {
70				changedArrows();
71
72				$('.owl-dots .owl-dot', $portfolio).each(function(i, e) {
73					$(e).attr('aria-label', i + 1);
74				});
75
76				$portfolio.closest('.portfolio-preloader-wrapper').prev('.preloader').remove();
77
78				$portfolio.initExtendedPortfolioGrids();
79			},
80			onChange: function () {
81				$('.owl-dots .owl-dot', $portfolio).each(function(i, e) {
82					$(e).attr('aria-label', i + 1);
83				});
84				if (window.tgpLazyItems !== undefined) {
85					window.tgpLazyItems.scrollHandle();
86				}
87			}
88		});
89
90		// Changed arrows
91		function changedArrows() {
92			$('.slider-prev-icon', $portfolio).appendTo($('.owl-nav .owl-prev', $galleryElement));
93			$('.slider-next-icon', $portfolio).appendTo($('.owl-nav .owl-next', $galleryElement));
94
95			var dotsHeight = $('.owl-dots', $portfolio).outerHeight() + parseInt($('.owl-dots', $portfolio).css('marginTop'));
96			$('.owl-nav .owl-prev', $galleryElement).css('top', 'calc(50% - '+dotsHeight+'px/2)');
97			$('.owl-nav .owl-next', $galleryElement).css('top', 'calc(50% - '+dotsHeight+'px/2)');
98		}
99
100		// Resize and orientation changes
101		window.addEventListener("resize", function () {
102			isTouch = window.gemSettings.isTouch;
103
104			$carouselItem.trigger('refresh.owl.carousel');
105
106		}, false);
107	}
108
109	$.fn.initPortfolioCarousels = function () {
110		var $portfolio = $(this);
111		if ($(this).hasClass('portfolio-carousel-inited')) {
112			return;
113		}
114		$(this).addClass('portfolio-carousel-inited');
115		setTimeout(function () {
116			$portfolio.addClass('ready');
117		}, 500);
118		$(this).each(initPortfolioCarousel);
119	};
120
121
122	$(document).ready(function () {
123		$('body:not(.elementor-editor-active) .extended-carousel-grid:is(.extended-portfolio-carousel, .extended-posts-carousel)').initPortfolioCarousels();
124	});
125
126})(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.