HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/lipovac/wp-content/plugins/js_composer/assets/js/components/vc_grid_style_all_masonry.js
/* =========================================================
 * vc_grid_style_all_masonry.js v1.0
 * =========================================================
 * Copyright 2014 Wpbakery
 *
 * Basic Grid Style show all with masonry grid
 * ========================================================= */
var vcGridStyleAllMasonry;
(function ( $ ) {
	// vcGridStyleAllMasonry = vcGridStyleAll.bind(); // IE 8 not supported
	vcGridStyleAllMasonry = function ( grid ) {
		this.grid = grid;
		this.settings = grid.settings;
		this.filterValue = null;
		this.$el = false;
		this.$content = false;
		this.isLoading = false;
		this.filtered = false;
		this.$loader = $( '<div class="vc_grid-loading"></div>' );
		this.masonryEnabled = false;
		_.bindAll( this, 'setMasonry' );
		this.init();
	};
	vcGridStyleAllMasonry.prototype = _.extend( {}, vcGridStyleAll.prototype, {
		showItems: function () {
			var $els = this.$content.find( '.vc_grid-item' + this.filterValue );
			var self = this;
			this.setIsLoading();
			$els.imagesLoaded( function () {
				$els.addClass( 'vc_visible-item' );
				self.setItems( $els );
				if ( self.filtered ) {
					self.filtered = false;
					self.setMasonry();
				}
				self.unsetIsLoading();
				window.vc_prettyPhoto();
			} );
		},
		filter: function ( filter ) {
			filter = _.isUndefined( filter ) || filter === '*' ? '' : filter;
			if ( this.filterValue == filter ) {
				return false; // already filtred
			}
			this.filterValue = filter;
			this.$content.data( 'masonry' ) && this.$content.masonry( 'destroy' );
			this.masonryEnabled = false;
			this.$content
				.find( '.vc_visible-item' )
				.removeClass( 'vc_visible-item' );
			this.$content
				.find( '.vc_grid-item' + this.filterValue );
			this.filtered = true;
			$( window ).resize( this.setMasonry );
			this.setMasonry();
			this.showItems();
		},
		setIsLoading: function () {
			this.$el.append( this.$loader );
			this.isLoading = true;
		},
		unsetIsLoading: function () {
			this.isLoading = false;
			this.$loader && this.$loader.remove();
		},
		setItems: function ( els ) {
			if ( this.masonryEnabled ) {
				this.$content.masonry( 'appended', els );
			}
			else {
				this.setMasonry();
			}
		},
		setMasonry: function () {
			var windowWidth = window.innerWidth;
			if ( windowWidth < vcGridSettings.mobileWindowWidth ) {
				this.$content.data( 'masonry' ) && this.$content.masonry( 'destroy' );
				this.masonryEnabled = false;
			} else if ( this.masonryEnabled ) {
				this.$content.masonry( 'reloadItems' );
				this.$content.masonry( 'layout' );
			} else {
				this.$content.masonry( { itemSelector: ".vc_visible-item", isResizeBound: false } );
				this.masonryEnabled = true;
			}
		}
	} );
})( window.jQuery );