PageSourceSearch

https://midlandhorseshoe.com/wp-content/plugins/wolf-core-master/assets/js/galleries.js?ver=2.1.28

js midlandhorseshoe.com collected 2026-10-04 10:32:12 UTC 3,427 bytes, 147 lines download raw bytes

1/*!
2 * Galleries
3 *
4 * WPBakery Page Builder Extension 3.2.8
5 */
6/* jshint -W062 */
7/* global DocumentTouch, WolfCore */
8var WolfCoreGalleries = function( $ ) {
9
10	"use strict";
11
12	return {
13
14		/**
15		 * Init UI
16		 */
17		init : function () {
18
19			var _this = this;
20
21			this.masonry();
22
23			$( window ).resize( function() {
24				_this.masonry();
25			} );
26
27			this.justify();
28			this.elementorTabSwitch();
29		},
30
31		elementorTabSwitch : function () {
32			var _this = this;
33
34			$( document ).on( 'click', '.e-n-tab-title', function () {
35				var tabIndex = $( this ).data( 'tab-index' );
36				var $tabWidget = $( this ).closest( '.elementor-widget-n-tabs' );
37				var $activePanel = $tabWidget.find( '.e-n-tabs-content > .e-con[data-tab-index="' + tabIndex + '"]' );
38
39				// console.log( '[WolfCoreGalleries] tabIndex', tabIndex, '| panel', $activePanel );
40
41				_this.masonry( $activePanel );
42			} );
43		},
44
45		masonry : function ( $scope ) {
46
47			var $masonry = $scope ? $scope.find( ".wolf-core-gallery-masonry" ) : $( ".wolf-core-gallery-masonry" );
48			var $metro   = $scope ? $scope.find( ".wolf-core-gallery-metro" )   : $( ".wolf-core-gallery-metro" );
49
50			if ( ! $masonry.length && ! $metro.length ) {
51				return;
52			}
53
54			var $window = $( window ).width();
55
56			// Disable isotope on mobile
57			if ( 800 > $window ) {
58
59				if ( $( ".wolf-core-gallery-isotope" ).length ) {
60
61					$( ".wolf-core-gallery-isotope" ).isotope( "destroy" ).removeClass( "wolf-core-gallery-isotope" );
62				}
63
64			} else {
65
66				$( ".wolf-core-gallery-masonry" ).imagesLoaded( function() {
67
68					if ( ! $( ".wolf-core-gallery-masonry" ).hasClass( "wolf-core-gallery-isotope" ) ) {
69
70						$( ".wolf-core-gallery-masonry" ).addClass( "wolf-core-gallery-isotope" );
71
72						$( ".wolf-core-gallery-masonry" ).isotope( {
73							itemSelector : ".wolf-core-img-masonry",
74							animationEngine : "best-available",
75							layoutMode : "masonry"
76						} );
77
78
79					} else {
80
81						$( ".wolf-core-gallery-masonry" ).isotope( "layout" );
82
83					}
84				} );
85
86				$( ".wolf-core-gallery-metro" ).imagesLoaded( function() {
87					if ( ! $( ".wolf-core-gallery-metro" ).hasClass( "wolf-core-gallery-isotope" ) ) {
88
89						$( ".wolf-core-gallery-metro" ).addClass( "wolf-core-gallery-isotope" );
90
91						$( ".wolf-core-gallery-metro" ).isotope( {
92							itemSelector : ".wolf-core-img-metro",
93							animationEngine : "none",
94							layoutMode : "packery"
95						} );
96
97					} else {
98
99						$( ".wolf-core-gallery-metro" ).isotope( "layout" );
100					}
101				} );
102
103			}
104		},
105
106		justify : function () {
107			if ( $( ".wolf-core-gallery-justified" ).length ) {
108
109				$( ".wolf-core-gallery-justified" ).imagesLoaded( function() {
110					//console.log( "set mosaic" );
111					$( ".wolf-core-gallery-justified" ).flexImages( {
112						rowHeight: 350,
113						container: ".wolf-core-img-justified"
114					} );
115				} );
116			}
117		}
118	};
119
120}( jQuery );
121
122( function( $ ) {
123
124	"use strict";
125
126	$( document ).ready( function() {
127		WolfCoreGalleries.init();
128	} );
129
130	$( window ).on( 'elementor/frontend/init', function() {
131		elementorFrontend.hooks.addAction( "frontend/element_ready/gallery.default", function( $scope ) {
132
133			if ( $scope.find(".wolf-core-gallery-justified") ) {
134				WolfCoreGalleries.justify();
135			}
136
137			if ( $scope.find(".wolf-core-gallery-masonry") ) {
138				WolfCoreGalleries.masonry();
139			}
140
141			if ( $scope.find(".wolf-core-gallery-metro") ) {
142				WolfCoreGalleries.masonry();
143			}
144		} );
145	} );
146
147} )( 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.